If you have existing messages in the broker and add consumers at a later
stage, it is a good idea to delay message dispatch start until all
consumers are present (or at least to give enough time for them to
subscribe). If you don't do that the first consumer will probably acquire
all message groups and all messages will be dispatched to it. You can
achieve this by usingconsumersBeforeDispatchStarts and
timeBeforeDispatchStarts destination policies
<http://activemq.apache.org/per-destination-policies.html>.
take a look at http://activemq.apache.org/message-groups.html