activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: One transacted consumer prevents other from consuming
Date Fri, 19 Mar 2010 10:44:34 GMT
set the prefetch=3 for your destination. see:
http://activemq.apache.org/what-is-the-prefetch-limit-for.html

On 18 March 2010 15:49, yair <yair@sundaysky.com> wrote:

>
> 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.
>
> Thanks,
> Yair
>
> --
> View this message in context:
> http://old.nabble.com/One-transacted-consumer-prevents-other-from-consuming-tp27947475p27947475.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
http://blog.garytully.com

Open Source Integration
http://fusesource.com

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message