Ben,
I have tested your BrowsingMessageReceiver with Weblogic JMS provider and seems to be working as expected (dequeueing and processing all the messages instead of stalling after the first). However, with ActiveMQ it appears to be not returning any messages after the first dequeue. I have had a quick look through your receiver. Few minor comments,
1. I don't think you need to bind the browser to the thread local as it is accessed by only the monitor thread.
2. Also, you may not need to start a transaction for browsing.
3. Since you are creating a session and consumer for every dequeue, you may need to make sure they are closed after the transaction commit. You could do this by having them as instance variables in the Work interface implementation and closing them in the release method.
HTH
Meeraj
Andrew,
That's a very good point.
Here's a tiny m2 based project to reproduce the error:
my-app.zip
The main class can be run from eclipse, its called EnqueueingClient.
This starts up activemq and mule.
The eclipse project can be generated by the m2 eclipse plugin.
It initially sends one message to the queue.
You can also send messages via the JMX console for ease of use (its bound to the namespace foo).
Thanks for your help,
Ben
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.