How can I configure a static network of TomEE embedded ActiveMQ brokers so that clients can communicate?
I have three TomEE instances running. I'd like to use one as a 'master' broker, and have two other instances connect to the master as clients. I would like for the clients to be able to send / receive messages to one another. The biggest requirement is that I must use static networking; simply pointing the ServerUrl in the clients' tomee.xml to the master URL is not an option. I've verified that I'm able to statically connect two containers and pass messages, but when I introduce the third container (the master), messages stop flowing from 'Client-A' to 'Client-B' Master tomee.xml: <Resource id="ra/activemq" type="ActiveMQResourceAdapter"> BrokerXmlConfig = broker:(tcp://127.0.0.1:61616,network:static:(tcp://127.0.0.1:61615,tcp://127.0.0.1:61617))/tomeeActiveMq?useJmx=true ServerUrl = tcp://127.0.0.1:61616 </Resource> Client-A tomee.xml: <Resource id="ra/activemq" type="ActiveMQResourceAdapter"> BrokerXmlConfig = broker:(tcp://127.0.0.1:61615,network:static:tcp://127.0.0.1:61616)/server0?useJmx=true&persistent=false ServerUrl = tcp://127.0.0.1:61615 </Resource> Client-B tomee.xml: <Resource id="ra/activemq" type="ActiveMQResourceAdapter"> BrokerXmlConfig = broker:(tcp://127.0.0.1:61617,network:static:tcp://127.0.0.1:61616)/server1?persistent=false&useJmx=true ServerUrl = tcp://127.0.0.1:61617 </Resource> My ActiveMQ console shows that both clients are indeed connected to the master via a static network: Here is a diagram of broker layout according to HawtIO: Thanks in advance.
For 3+ broker networks, you need to set the networkTTL option to something more than 1, which is default. The TTL option sets the max limit on how many network brokers a message can reach. So, by default you can communicate c1<->master and c2<->master but not c1<->c2 in the same network. Not sure how to pass that option via URI in a resource adapter though. More about the network of brokers configuration
Camel Activemq property JMSDestination value different between 5.12.1 and 5.13.0
ActiveMQ MQTT Producer not publish to openwire Subscriber
Is there a way to dump messages from an ActiveMQ queue and then reimport them?
ActiveMQ replicated levelDB with zookeeper, client must know all brokers?
Flush Messages in wildfly 10 (activemq) programatically
ActiveMQ - Update on Connect?
Programatically disable ActiveMQ message redelivery
How many message Id should I cache to avoid duplicate messages in ActiveMQ?
Unable to configure a distributed transaction involving ActiveMQ and embedded H2 with Atomikos
ActiveMQ network subscription issue
ActiveMQ Fail over issue with MySql DB
Active Mq : How to stop active mq from creating queue which doesnt exist
Cannot shutdown activeMQ gracefully after JMX port change
Why does a POST to an Apache ActiveMQ using the REST API add a linefeed to the end of the message?
Is it possible to have both kahaDB and memoryPersistenceAdapter for different queues in Activemq?
Is ActiveMQ really that bad in clustering?