activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yair <>
Subject One transacted consumer prevents other from consuming
Date Thu, 18 Mar 2010 15:49:01 GMT

Hi all
I have a job's queue, from which a worker receives messages to work on.
Each time the worker decides to take a job (it can handle more than on the
same time) it calls createQueueSession with transacted=true, creates a
consumer, receives a message, and keep these 3 objects until the job's
handling is over.
If, while the job is handled (and the transacted session is still alive),
the worker tries to get another message (by creating a new session and so
on), it doesn't get any messages from the queue even if they are messages
waiting beside the one it already handles. Even if another worker tries, it
gets nothing.
This means that the session and consumer the first worker creates, get some
how a lock on the queue, and no other consumer can get messages from it.

How can I fix this? I need to keep the session transacted because I want the
message to be deleted from the queue only when the worker is done with it.
If the worker crashes, for example, I need the message to return to the
queue so other workers can handle it. This is working well now.


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message