1 of 1 people found this helpful
Now I want to implement grouping handler so that messages with a particular group_id always go to same node of the cluster.
Message grouping ensures that all message in the same group go to the same consumer, not necessarily to the same node in the cluster. Take a look at the "clustered-grouping" example in the HornetQ distribution.
Thanks for the quick reply....From Grouping example i saw "Using message groups in a cluster is a bit more complex. This is because messages with a particular group id can arrive on any node so each node needs to know about which group id's are bound to which consumer on which node. The consumer handling messages for a particular group id may be on a different node of the cluster, so each node needs to know this information so it can route the message correctly to the node which has that consumer."
So in a cluster it works in two steps
1. The messages will be forwarded to the node where consumer is.
2.Then the correct consumer will receive it.
So if the first step is happening properly, It should forward to the node where it listen first time right. Then it looks for the consumer.
Please correct me if I am wrong .
Assuming that the consumer hasn't disconnected or anything like that then yes the message will go back to the same node and then to the same consumer.
Here an issue. Consider 2 scenarios.
Every node has single consumer which has the same name. In that case The messages are moved to the cluster node where it is processed initially.
I mean It looks for the consumer name first in the current queue. If it find, It is processed to the same consumer of that queue instead forward to the node where it was processed before.
This works fine when there are different named consumers across different queues. I feel like this has to configurable parameters so that user can configure it.
I don't understand what you mean. Can you provide a test-case to demonstrate the issue so it will be clear?