I have 2 servers server1 and server2. server1 is the master server and server2 is slave. Both are running in clustered environment.
If 2 messages with same group ID arrives simultaneously on node 1 and node 2 they won't know to which consumer the message should be sent to. Therefore, the message ends up being processed by different consumers and sometimes the message which arrived first gets processed later which is not desirable.
I would like to configure the system so that both nodes know each other that the message should be processed by which consumer.
Solution I tried : Configured the server1 with group handler LOCAL and server2 with REMOTE. Now whenever the message arrives LOCAL group handler identifies that the consumer is on which node and the message is picked accordingly.
This solution is valid until the server1 is running fine. However, if the server1 goes down messages won't be processed anymore.
To fix this I added backup server to messaging subsystem active mq of server1 to server2 and similarly did the same for server2.
/profile=garima/subsystem=messaging-activemq/server=backup:add
And added the same cluster-connection, discovery-group, http-connector, broadcast-group to this backup server but when I tried this solution did not seems to fix the failover condition and messages were not processed on other node.
Please suggest any other approach or how can I configure the scenario where the server with LOCAL group handler stops.