Set Message Grouping Using JMS
28.2. Using JMS The property name used to identify the message group is JMSXGroupID. // send 2 messages in the same group to ensure the same // consumer will receive both Message message = ... message.setStringProperty("JMSXGroupID", "Group-0"); producer.send(message); message = ... message.setStringProperty("JMSXGroupID", "Group-0"); producer.send(message); Alternatively, you can set autogroup to true on the HornetQConnectonFactory which will pick a random unique id. This can also be set in the hornetq-jms.xml file like this: true Alternatively you can set the group id via the connection factory. All messages sent with producers created via this connection factory will set the JMSXGroupID to the specified value on all messages sent. To configure the group id set it on the connection factory in the hornetq-jms.xml config file as follows Group-0