I have tried to isolate ActiveMQ's behaviour with a pure JMS client but following the same threading strategy, to no avail, so I have created a test case within a m2 project and have posted it to ActiveMQ's JIRA:
https://issues.apache.org/activemq/browse/AMQ-900
Andrew Perepelytsya wrote:
I know there were issues with queue browsers in ActiveMQ before. Not that it
wasn't fixed by v4 (I just don't know now). Before that it resulted in
messages getting reordered randomly.
The problem will need some investigation. Could you also list the activemq
config file. Generally, the easier you make to reproduce the scenario (test
client, etc.) the higher the chances are you'll get feedback.
Andrew