I'm using Apache Camel and Karaf for creating a routing engine product.
One of them components that I'm using extensively in it is ActiveMQ.
An external system will send a request to the routing engine which it will forward to one of the distributed instance via jms Queue (InOut messaging).
This instance will then process the request, put it back in the response Queue configured/mentioned in the request.
I'm glag that InOut messaging already supports non-blocking HTTP process like behaviour which was most important for me.
Even though the request from routing engine to distributed instance is async, this is hidden from the external system sending the request to the engine and to that it is sync behaviour.
Now, two of my major concerns are scalability and failover mechanism for ActiveMQ broker and Karaf.
For broker, I read about Master-Slave pattern and Network of Brokers.
I tried both, and in both case, at a time only one broker is active and processing the request. The other brokers remain in wait state waiting for obtaining the lock.
This handles my failover concern quite well.
But scalability is still the issue.
May be I haven't clearly understood Network of Broker principle quite well. So let me just explain my requirement.
Consider that we have one broker now configured with a pooled connnection factory with maxConnections, concurrentConsumers, maxConcurrentConsumers, maximumActiveSessionPerConnection, etc fine tuning paramters.
What I want to target is that let's say if any point I see that this fine tuning is not enough for scaling at certain extent, then I'll add additional brokers in the network which will shared the load.
So, we have let's say Broker A, B and C in network, each having same queues. If 90 request arrive at Broker A for Q1, it will share the load between 3 brokers spiliting 30 requests among A,B and C.
In future, if we want to scale it further, just add another broker instance in the cluster and that's it.
Is this the idea of Network of Brokers? If yes, any tutorial which will help me in implementing this?
NOTE: I'm using persisted messaging and using Orcle DB as persistence adapter.
In general, what are the best practices for scalability and failover for activemq?