You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mkonda <kn...@hotmail.com> on 2009/07/10 12:52:22 UTC
Introducing delay on a Consumer
I got a specific issue - I need to introduce a delay in sending a message to
a second consumer. Let me explain:
There are two consumer on one Destination. A user is connected to only one
of these consumers at any time. So, if one consumer is doing process (say,
BUSY), the users are routed to the second consumer.
The flow is like this:
First consumer will receive the message. It then changes its state to BUSY
so users are routed to second consumer. It does the some process upon
receiving the message (while the second consumer shouldn't receive at all
but serves the users though).
Once the first consumer finishes the process, the second consumer should
receive the same message. So, the second consumer becomes BUSY while first
consumer now servers the users. It does same process as first consumer.
BOTH consumers are EXACTLY SAME - they do the EXACT process. The only
difference is that - only one of the consumers will be exposed to the
external client.
So, my question is - is there a way to ask the Second consumer to pick up
the message only when first consumer finishes?
(Remember that the processing will swap from first to second consumer and
from second consumer to first)
Any thoughts (I'll sincerely appreiate)
--
View this message in context: http://www.nabble.com/Introducing-delay-on-a-Consumer-tp24425259p24425259.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.
Re: Introducing delay on a Consumer
Posted by Joe Fernandez <jo...@ttmsolutions.com>.
What about using a prefetch limit of 1 in combination with client
acknowledge?
Joe
http://www.ttmsolutions.com
mkonda wrote:
>
> I got a specific issue - I need to introduce a delay in sending a message
> to a second consumer. Let me explain:
>
> There are two consumer on one Destination. A user is connected to only one
> of these consumers at any time. So, if one consumer is doing process (say,
> BUSY), the users are routed to the second consumer.
>
> The flow is like this:
>
> First consumer will receive the message. It then changes its state to BUSY
> so users are routed to second consumer. It does the some process upon
> receiving the message (while the second consumer shouldn't receive at all
> but serves the users though).
>
> Once the first consumer finishes the process, the second consumer should
> receive the same message. So, the second consumer becomes BUSY while first
> consumer now servers the users. It does same process as first consumer.
>
> BOTH consumers are EXACTLY SAME - they do the EXACT process. The only
> difference is that - only one of the consumers will be exposed to the
> external client.
>
> So, my question is - is there a way to ask the Second consumer to pick up
> the message only when first consumer finishes?
>
> (Remember that the processing will swap from first to second consumer and
> from second consumer to first)
>
> Any thoughts (I'll sincerely appreiate)
>
--
View this message in context: http://www.nabble.com/Introducing-delay-on-a-Consumer-tp24425259p24426893.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.