Reputation: 15480
First of all, I'll explain the scenario.
I have two nodes of WSO2 ESB (4.9.0) and two nodes of Apache ActiveMQ, running in four different machines. Currently, each ESB node points to one node of ActiveMQ:
ESB1 -> AMQ1
ESB2 -> AMQ2
In this case, if one AMQ node goes down, only one node of ESB will be able to produce and consume messages.
Thinking about a way to solve this, and implement high availability, I've found a section in ActiveMQ documentation that describes an url syntax to configure failover.
So, in each ESB, I've configured a Message Processor attached to a Message Store with the provider url configured as the docs says:
failover:(tcp://soamsg01:61616,tcp://soamsg02:61616)
Now the message storing process was "partially" solved. The insertion of messages occurs always in the same AMQ node in each ESB, but if the node goes down, the insertion goes to the another.
The main problem is with the consumption. When the Message Processor starts, it chooses randomly one of the AMQ nodes to connect. So, the two ESB nodes may connect to the same node of AMQ, causing one of the queues to be never read.
There's a way to solve this?
Upvotes: 0
Views: 261
Reputation: 5946
A solution is to configure ActiveMQ in master/slave. The goal is to have the different ActiveMQ nodes using the same database : you can share kahadb in a shared filesystem or you can use a shared database, see http://activemq.apache.org/masterslave.html
All your ESB nodes will connect to the same ActiveMQ instance and in case of failure, a passive node will become active and all your ESB nodes will connect to it. This new ActiveMQ node will continue to serve the sames queues and topics with the same content because thoses datas are stored in a unique database.
Upvotes: 1