1.ActiveMQ Network Bridging 1.1 ActiveMQtransmission Mode
ActiveMQ by means of communication: bridging and forwarding and bidirectional communication
1. bridging forwarding is a Broker that passes messages to another ActiveMQ .
2. Two-way communication is the use of a channel can either receive messages or send messages.
The message that is pushed to Broker1 is automatically forwarded to Broker2 ,Broker2 does not need to modify any settings, only Broker1 you can make changes.
1.2ActivemqNetwork Bridging configurationBin/activemq.xml
| <bean id= "Bridgedbroker" class= "Org.apache.activemq.broker.BrokerService" init-method= "Start" destroy-method= " Stop "> <property name= "Brokername" value = "Bridgedbroker"/> <property name= "Persistent" value= "false"/> <property name= "Transportconnectoruris" > <list> <!-- message production queue -- <value>tcp://localhost:61616</value> </list> </property> <property name= "Jmsbridgeconnectors" > <list> <bean class= "Org.apache.activemq.network.jms.JmsQueueConnector" > <property name= "Outboundqueueconnectionfactory" > <bean class= "Org.apache.activemq.ActiveMQConnectionFactory" > <!-- consumer queue address -- <property name= "Brokerurl" value= "tcp://10.1.230.200:61616"/> </bean> </property> <property name= "Outboundqueuebridges" > <list> <bean class= "Org.apache.activemq.network.jms.OutboundQueueBridge" > <!-- only forward the message queue -- <constructor-arg value= "Messages.input"/> </bean> </list> </property> </bean> </list> </property> </bean> |
1.3Example
Scene:
After the native ActiveMQ is started, after the queue is created, then click Send to send a message to the queue.
Third-party queues are default empty after they are started.
After we send a message to the first MQ , we should forward the message through our configured address. This way, the second MQ should receive A message that is forwarded over ten.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
ActiveMQ Bridge Connection