You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ego <er...@yahoo.fr> on 2007/05/28 17:41:41 UTC

Kind of "consumer faliover"

Hey,

I'm not sure that my problem stands for "consumer failover". I would like to
know if it's possible to have a group of consumers, listening the same
Topic. Only one of the consumers is allowed to process the same message. The
idea is that if one of the consumer die, the other consumers of my "cluster"
can always process the new messages.

Thanks
-- 
View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a10838068
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Kind of "consumer faliover"

Posted by James Strachan <ja...@gmail.com>.
On 6/7/07, ego <er...@yahoo.fr> wrote:
>
> Yes ! It's exactly what I need !!
> Thank you >----(^_^)----<

You're most welcome :)

James

>
> James.Strachan wrote:
> >
> > On 5/30/07, ego <er...@yahoo.fr> wrote:
> >>
> >> You're probably true. So here is my 'real' problem.
> >>
> >> I need a producer that publish let's say an event E1. I have 3 different
> >> consumers, each doing a specific task with the event E1. For each
> >> consumer,
> >> I need to find a "backup" solution if the consumer fails, i.e. to
> >> automatically "switch" to a backup consumer so that no event is lost. The
> >> backup consumer must act as if it were the master consumer; something
> >> like a
> >> durable subscriber, but a subscriber that can automatically restart on
> >> another machine with the same "identity".
> >>
> >> No sure it's clear..............
> >
> > Sounds like you want Virtual Topics...
> >
> > http://activemq.apache.org/virtual-destinations.html
> >
> > each logical consumer gets its own queue so you can have backup
> > consumers, load balancing etc.
> >
> > --
> > James
> > -------
> > http://macstrac.blogspot.com/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a11012353
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
James
-------
http://macstrac.blogspot.com/

Re: Kind of "consumer faliover"

Posted by ego <er...@yahoo.fr>.
Yes ! It's exactly what I need !!
Thank you >----(^_^)----<

James.Strachan wrote:
> 
> On 5/30/07, ego <er...@yahoo.fr> wrote:
>>
>> You're probably true. So here is my 'real' problem.
>>
>> I need a producer that publish let's say an event E1. I have 3 different
>> consumers, each doing a specific task with the event E1. For each
>> consumer,
>> I need to find a "backup" solution if the consumer fails, i.e. to
>> automatically "switch" to a backup consumer so that no event is lost. The
>> backup consumer must act as if it were the master consumer; something
>> like a
>> durable subscriber, but a subscriber that can automatically restart on
>> another machine with the same "identity".
>>
>> No sure it's clear..............
> 
> Sounds like you want Virtual Topics...
> 
> http://activemq.apache.org/virtual-destinations.html
> 
> each logical consumer gets its own queue so you can have backup
> consumers, load balancing etc.
> 
> -- 
> James
> -------
> http://macstrac.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a11012353
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Kind of "consumer faliover"

Posted by James Strachan <ja...@gmail.com>.
On 5/30/07, ego <er...@yahoo.fr> wrote:
>
> You're probably true. So here is my 'real' problem.
>
> I need a producer that publish let's say an event E1. I have 3 different
> consumers, each doing a specific task with the event E1. For each consumer,
> I need to find a "backup" solution if the consumer fails, i.e. to
> automatically "switch" to a backup consumer so that no event is lost. The
> backup consumer must act as if it were the master consumer; something like a
> durable subscriber, but a subscriber that can automatically restart on
> another machine with the same "identity".
>
> No sure it's clear..............

Sounds like you want Virtual Topics...

http://activemq.apache.org/virtual-destinations.html

each logical consumer gets its own queue so you can have backup
consumers, load balancing etc.

-- 
James
-------
http://macstrac.blogspot.com/

Re: Kind of "consumer faliover"

Posted by ego <er...@yahoo.fr>.
thanks for your response
And ok, may be too difficult !??!!


Tom Samplonius-2 wrote:
> 
> 
> ----- "ego" <er...@yahoo.fr> wrote:
>> You're probably true. So here is my 'real' problem.
>> 
>> I need a producer that publish let's say an event E1. I have 3
>> different
>> consumers, each doing a specific task with the event E1. For each
>> consumer,
>> I need to find a "backup" solution if the consumer fails, i.e. to
>> automatically "switch" to a backup consumer so that no event is lost.
>> The
>> backup consumer must act as if it were the master consumer; something
>> like a
>> durable subscriber, but a subscriber that can automatically restart
>> on
>> another machine with the same "identity".
>> 
>> No sure it's clear..............
> 
> 
>   Well, it sounds a bit difficult.  I would say if the messages are small,
> just send three copies, one to each queue, and use the exclusive consumer
> feature.  You can probably sent all three messages in a transaction to
> make sure all or none are sent.
> 
>   I don't know if JMS has "presence" support, so a consumer can ask, or be
> notified if another consumer disconnects.  You might see this in the XMPP
> protocol for ActiveMQ, but I have not not look at it before.  I know the
> big advantage of XMPP, is presence (and discovery).  The big downside to
> XMPP, is lack of confirmed delivery (no transactions, but XEP-Transaction
> looks promising).  So if a client crashes while processing a message, you
> are not sure if it finished that message or not.
> 
> Tom
> 
>   
> 
> 

-- 
View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a10898881
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Kind of "consumer faliover"

Posted by Tom Samplonius <to...@samplonius.org>.
----- "ego" <er...@yahoo.fr> wrote:
> You're probably true. So here is my 'real' problem.
> 
> I need a producer that publish let's say an event E1. I have 3
> different
> consumers, each doing a specific task with the event E1. For each
> consumer,
> I need to find a "backup" solution if the consumer fails, i.e. to
> automatically "switch" to a backup consumer so that no event is lost.
> The
> backup consumer must act as if it were the master consumer; something
> like a
> durable subscriber, but a subscriber that can automatically restart
> on
> another machine with the same "identity".
> 
> No sure it's clear..............


  Well, it sounds a bit difficult.  I would say if the messages are small, just send three copies, one to each queue, and use the exclusive consumer feature.  You can probably sent all three messages in a transaction to make sure all or none are sent.

  I don't know if JMS has "presence" support, so a consumer can ask, or be notified if another consumer disconnects.  You might see this in the XMPP protocol for ActiveMQ, but I have not not look at it before.  I know the big advantage of XMPP, is presence (and discovery).  The big downside to XMPP, is lack of confirmed delivery (no transactions, but XEP-Transaction looks promising).  So if a client crashes while processing a message, you are not sure if it finished that message or not.

Tom

  

Re: Kind of "consumer faliover"

Posted by ego <er...@yahoo.fr>.
You're probably true. So here is my 'real' problem.

I need a producer that publish let's say an event E1. I have 3 different
consumers, each doing a specific task with the event E1. For each consumer,
I need to find a "backup" solution if the consumer fails, i.e. to
automatically "switch" to a backup consumer so that no event is lost. The
backup consumer must act as if it were the master consumer; something like a
durable subscriber, but a subscriber that can automatically restart on
another machine with the same "identity".

No sure it's clear..............


Tom Samplonius-2 wrote:
> 
> 
> ----- "ego" <er...@yahoo.fr> wrote:
>> ok for the queue so it's not possible for Topic consumers ?
>> 
> 
>   I guess, the real question is why?
> 
>   If you only want your message to go to a single consumer, why even use
> topics?  You requirements is for queue behavior, so I think you should use
> a queue.
> 
> Tom
> 
> 

-- 
View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a10879505
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Kind of "consumer faliover"

Posted by Tom Samplonius <to...@samplonius.org>.
----- "ego" <er...@yahoo.fr> wrote:
> ok for the queue so it's not possible for Topic consumers ?
> 

  I guess, the real question is why?

  If you only want your message to go to a single consumer, why even use topics?  You requirements is for queue behavior, so I think you should use a queue.

Tom

Re: Kind of "consumer faliover"

Posted by ego <er...@yahoo.fr>.
ok for the queue so it's not possible for Topic consumers ?

Tom Samplonius-2 wrote:
> 
> 
> ----- "ego" <er...@yahoo.fr> wrote:
>> Hey,
>> 
>> I'm not sure that my problem stands for "consumer failover". I would
>> like to
>> know if it's possible to have a group of consumers, listening the
>> same
>> Topic. Only one of the consumers is allowed to process the same
>> message. The
>> idea is that if one of the consumer die, the other consumers of my
>> "cluster"
>> can always process the new messages.
> 
>   I think you can do this, if you use a queue, instead of a topic, and
> mark the consumer as "exclusive".  Topics are for one-to-many
> communications anyways, so definitely not what you want.
> 
> http://activemq.apache.org/exclusive-consumer.html
> 
> 
> Tom
> 
> 

-- 
View this message in context: http://www.nabble.com/Kind-of-%22consumer-faliover%22-tf3828623s2354.html#a10858167
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Kind of "consumer faliover"

Posted by Tom Samplonius <to...@samplonius.org>.
----- "ego" <er...@yahoo.fr> wrote:
> Hey,
> 
> I'm not sure that my problem stands for "consumer failover". I would
> like to
> know if it's possible to have a group of consumers, listening the
> same
> Topic. Only one of the consumers is allowed to process the same
> message. The
> idea is that if one of the consumer die, the other consumers of my
> "cluster"
> can always process the new messages.

  I think you can do this, if you use a queue, instead of a topic, and mark the consumer as "exclusive".  Topics are for one-to-many communications anyways, so definitely not what you want.

http://activemq.apache.org/exclusive-consumer.html


Tom