與遠端 Broker 的 JMS 橋接

使用 ActiveMQ Classic > 使用者提交的設定 > 與遠端 Broker 的 JMS 橋接

一個展示如何使用 BridgeConnector 連接到遠端 ActiveMQ Classic broker 的設定範例。

<beans>
    <!-- Allows us to use system properties as variables in this configuration file -->
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

    <broker useJmx="true" persistent="false" xmlns="http://activemq.org/config/1.0"
            brokerName="localhost" dataDirectory="${activemq.base}/data">
        <jmsBridgeConnectors>
            <jmsQueueConnector outboundQueueConnectionFactory="#remoteBroker">
                <inboundQueueBridges>
                    <inboundQueueBridge
                            inboundQueueName = "queue.ping"
                            localQueueName   = "queue.incomingMsgs.ping"
                            selector         = "JMSType LIKE 'foo%'"/>
                </inboundQueueBridges>
                <outboundQueueBridges>
                    <outboundQueueBridge
                            outboundQueueName = "queue.pong"
                            localQueueName    = "queue.incomingMsgs.ping"
                            selector          = "JMSType LIKE 'foo%'"/>
                </outboundQueueBridges>
            </jmsQueueConnector>
        </jmsBridgeConnectors>
    </broker>

    <!-- JMS ConnectionFactory to use for remote bridging -->
    <bean id="remoteBroker" class="org.apache.activemq.ActiveMQConnectionFactory">
        <property name="brokerURL" value="failover:(tcp://remote_activemq:61616)" />
    </bean>
</beans>

Apache, ActiveMQ, Apache ActiveMQ,Apache 羽毛標誌以及 Apache ActiveMQ 專案標誌是 The Apache Software Foundation 的商標。版權所有 © 2024, The Apache Software Foundation。授權條款遵循 Apache License 2.0