We have one MQ queue that receives messages from an external system outside our control. Our incoming message processing system is critical and needs to be up and running 27x7 no matter what.
The procedure for processing incoming messages is also not subject to discussion, which means that we must process them in the exact order in which they were received.
To make sure our system is 100% accessible, we deployed our system to a bunch of physical machines capable of handling these messages.
As soon as the messages reached our system, we created a mechanism to make sure that message processing does not fail, and also receives some performance enhancement as a result of parallel processing. For us, the advantage in performance is good, but it is rather a side effect, since our main goal is high availability while ensuring the correct processing order.
My thoughts were that on each machine, the MDB could process incoming messages, but only one active consumer at a time.
We use Webshere MQ as a JMS provider and WebShere Application Server 8.5 to deploy our application.
The problem with several consumers who listen to the same queue does not seem to be a workable solution, because when messages arrive in bulk, they will be cyclically transmitted to all consumers, and there is no way to control how this happens and messages easily exit the sequence.
When I manually stopped all the listeners, but obviously the messages were processed in order. But manually turning off and starting such listeners is certainly not a HA solution.
We could implement monitoring processes to test the system and shut them down or run them as needed, but it still looks too weak for me. In fact, we want all listeners to work, but only one will receive messages. If this happens for some reason, then the other one sitting there will become active and begin to process messages.
We initially looked at using a topic rather than a queue, but this is due to other issues, as shown below:
- we cannot control the source of our messages
- the large volume of messages that we have will put us in trouble with our subscribers, who must be durable, and when you return back, you will have to deal with many waiting messages.
- input queues are already part of the cluster, and a lot of work will be required to change the entire infrastructure.
In any case, in my opinion, this should be an existing template for situations like this. Any help, suggestion would be very helpful.
The solution does not have to be a specific MQ, any idea is welcome.
Thanks in advance