You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by salemi <al...@udo.edu> on 2013/10/07 23:41:09 UTC

How to implement two consumers on a topic (Camel). One of consumers is inactive until the active one fails?

How to implement two consumers on a topic. One of the consumers is inactive
until the active one fails? 

Our approach was to start two clients with the same clientId and
durableSubscriptionName. But when we kill the first client, the second
client doesn't reconnect automaticly!

<from
uri="jms:topic:mytopic?clientId=1&amp;durableSubscriptionName=EP_CAMEL1"/>





--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-implement-two-consumers-on-a-topic-Camel-One-of-consumers-is-inactive-until-the-active-one-fa-tp4672355.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to implement two consumers on a topic (Camel). One of consumers is inactive until the active one fails?

Posted by Willem jiang <wi...@gmail.com>.
ZooKeeper provides a Leader election implementation[1], it is useful for us to implement failover cluster.  


ZooKeeperRoutePolicy uses the leader election capabilities of a ZooKeeper cluster to control how routes are enabled. It is typically used in fail-over scenarios controlling identical instances of a route across a cluster of Camel based servers.


[1]http://zookeeper.apache.org/doc/current/recipes.html#sc_leaderElection



--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 1:14 PM, salemi wrote:

> Hi Wilem,
>  
> I don't understand how zookeeper would solve my issue?
>  
> Could you explain?
>  
> Ali
>  
>  
>  
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-implement-two-consumers-on-a-topic-Camel-One-of-consumers-is-inactive-until-the-active-one-fa-tp4672355p4672367.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com (http://Nabble.com).




Re: How to implement two consumers on a topic (Camel). One of consumers is inactive until the active one fails?

Posted by salemi <al...@udo.edu>.
Hi Wilem,

I don't understand how zookeeper would solve my issue?

Could you explain?

Ali



--
View this message in context: http://activemq.2283324.n4.nabble.com/How-to-implement-two-consumers-on-a-topic-Camel-One-of-consumers-is-inactive-until-the-active-one-fa-tp4672355p4672367.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: How to implement two consumers on a topic (Camel). One of consumers is inactive until the active one fails?

Posted by Willem jiang <wi...@gmail.com>.
Hi,  

Did you try to use camel-zookeeper[1]?
[1]http://camel.apache.org/zookeeper.html#Zookeeper-ZooKeeperenabledRoutepolicy.


--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, October 8, 2013 at 5:41 AM, salemi wrote:

> How to implement two consumers on a topic. One of the consumers is inactive
> until the active one fails?  
>  
> Our approach was to start two clients with the same clientId and
> durableSubscriptionName. But when we kill the first client, the second
> client doesn't reconnect automaticly!
>  
> <from
> uri="jms:topic:mytopic?clientId=1&amp;durableSubscriptionName=EP_CAMEL1"/>
>  
>  
>  
>  
>  
> --
> View this message in context: http://activemq.2283324.n4.nabble.com/How-to-implement-two-consumers-on-a-topic-Camel-One-of-consumers-is-inactive-until-the-active-one-fa-tp4672355.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com (http://Nabble.com).