I have a queue on Wildfly 8.2 (JMS with default HornetQ) which receives messages relative to different entities with different MDB Classes as consumers (one MDB Class for each Entity).
I use The JMSType to send messages relative to Entity A to the MDB_A and so on.
Now I want that all messages relative to the same instance of Entity A are managed by the same instance of MDB_A. Before I insert the message in the queue I set the same value for the property JMSXGroupID for messages relative to the same instance of A.
Then I print out in the MDB an identifier of the MDB and the JMSXGroupID of the message, but I see that messages with same JMSXGroupID are managed by different MDBs.
I found this thread talking of this issue for AciveMQ, but I'm using HornetQ so I don't know what is behaviour in this case.
In that thread an answer was
In this case the Message Listener is the MDB container not the individual MDB instances. MDB container is free to select any mdb instance to process the message it received.So I think the JMSXGroupID has no significance here.
but if messages with same JMSXMessageID are processed by different instances, what is the purpose of this property? Isn't it the same as setting a JMSType for the messages?
I also found that setting the JMSXMessageID for messages on a Queue without selectors let all the messages be processed by the same instance of MDB, even if I have multiple instances available.