You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Preethi <pr...@gmail.com> on 2013/12/30 16:53:49 UTC

Master Slave Camel-ActiveMQ

Hi

We are trying to setup Master slave for ActiveMQ using camel-context. Our
current architecture is like this.


   1.  A camel route which subscribes to MQ topics (these MQ topics are IBM
topics).
   2.  This camel route then takes the message from the topic and transforms
it
   3.  The transformed message is saved in the database.

I have been trying to setup master slave but have not been successful so
far. This is what I'm doing

A.An instance of this application deployed on  tomcat.
B.The slave is just another instance of this same application.Please note
that the clientids and the subscriber names are the same on both these
instances. Hence the slave would give the following exception , which is
expected.

Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT' using
MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ
call failed with compcode '2' ('MQCC_FAILED') reason '2429'
('MQRC_SUBSCRIPTION_IN_USE').


We are using the default KahaDBPersistenceAdapter . The issue here is that
the slave container runs for few hours and just dies due to insufficient
java heap space.
I was trying to configure the kahadb adapter to not poll every 2-3 seconds ,
which it seems to be doing , but haven't been successful so far.

 How do I configure the kahadb to poll during longer intervals (say 5 mins)?
Or are there any more options other than the kahadb for this Master Slave
setup?



--
View this message in context: http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Master Slave Camel-ActiveMQ

Posted by Henryk Konsek <he...@gmail.com>.
> I couldn't resist and summarized different ways for achieving master slave
> configurations in a blog post here
>
> http://www.ofbizian.com/2014/01/masterslave-failover-for-camel-routes.html

Great summary Bilgin. Kudos :) .

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: Master Slave Camel-ActiveMQ

Posted by Bilgin Ibryam <bi...@gmail.com>.
I couldn't resist and summarized different ways for achieving master slave
configurations in a blog post here

http://www.ofbizian.com/2014/01/masterslave-failover-for-camel-routes.html

Cheers,




On 3 January 2014 02:17, Willem Jiang <wi...@gmail.com> wrote:

> There is one shortcoming of the Zookeeper policy, the route is started
> before the route policy get a chance to stop the consumer.
>
> If you are using JBoss Fuse, you can try to camel master component[1], it
> just starts the master component at the first place.
>
> [1]
> https://access.redhat.com/site/documentation/en-US/JBoss_Fuse/6.0/html/EIP_Component_Reference/files/Master.html
>
> --
> 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 January 3, 2014 at 9:43:13 AM, Preethi (preethi.krishnan14@gmail.com)
> wrote:
> >
> > I have been trying to use zookeeper but it looks like the camel
> > route on the
> > slave, which is subscribing to the IBM MQ,still runs. I could
> > see the
> > exception below when I start the slave.
> >
> > Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT'
> > using
> > MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001:
> > WebSphere MQ
> > call failed with compcode '2' ('MQCC_FAILED') reason '2429'
> > ('MQRC_SUBSCRIPTION_IN_USE').
> >
> > This means that the slave is connecting the IBM MQ even with the
> > zookeeper
> > route policy enabled. Is there a way I can have a single route running
> > at a
> > time among multiple similar routes?
> >
> >
> >
> > --
> > View this message in context:
> http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360p5745453.html
> > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
>
>


-- 
Bilgin Ibryam

Apache Camel & Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam <https://twitter.com/bibryam>

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475

Re: Master Slave Camel-ActiveMQ

Posted by Willem Jiang <wi...@gmail.com>.
There is one shortcoming of the Zookeeper policy, the route is started before the route policy get a chance to stop the consumer.

If you are using JBoss Fuse, you can try to camel master component[1], it just starts the master component at the first place.

[1]https://access.redhat.com/site/documentation/en-US/JBoss_Fuse/6.0/html/EIP_Component_Reference/files/Master.html

--  
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 January 3, 2014 at 9:43:13 AM, Preethi (preethi.krishnan14@gmail.com) wrote:
>  
> I have been trying to use zookeeper but it looks like the camel  
> route on the
> slave, which is subscribing to the IBM MQ,still runs. I could  
> see the
> exception below when I start the slave.
>  
> Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT'  
> using
> MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001:  
> WebSphere MQ
> call failed with compcode '2' ('MQCC_FAILED') reason '2429'  
> ('MQRC_SUBSCRIPTION_IN_USE').
>  
> This means that the slave is connecting the IBM MQ even with the  
> zookeeper
> route policy enabled. Is there a way I can have a single route running  
> at a
> time among multiple similar routes?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360p5745453.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.  
>  


Re: Master Slave Camel-ActiveMQ

Posted by Preethi <pr...@gmail.com>.
I have been trying to use zookeeper but it looks like the camel route on the
slave, which is subscribing to the IBM MQ,still runs. I could see the
exception below when I start the slave.

Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT' using
MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ
call failed with compcode '2' ('MQCC_FAILED') reason '2429'
('MQRC_SUBSCRIPTION_IN_USE'). 

This means that the slave is connecting the IBM MQ even with the zookeeper
route policy enabled. Is there a way I can have a single route running at a
time among multiple similar routes?



--
View this message in context: http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360p5745453.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Master Slave Camel-ActiveMQ

Posted by Henryk Konsek <he...@gmail.com>.
Hi,

> You don’t need to let the Slave run when the Master is in charge.
> I think you can take a look at the camel-zookeeper[1].

The other two options for singleton clustering are:

a) Master component [1] from Fuse Fabric [2] (if you deploy your
application on Karaf/ServiceMix)
b) JGroups component [3]

Choose your weapon :) .

Cheers.

[1] https://access.redhat.com/site/documentation/en-US/JBoss_Fuse/6.0/html/EIP_Component_Reference/files/Master.html
[2] [1] http://fuse.fusesource.org/fabric/
[3] http://camel.apache.org/jgroups

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Re: Master Slave Camel-ActiveMQ

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

You don’t need to let the Slave run when the Master is in charge. I think you can take a look at the 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 December 31, 2013 at 9:45:04 AM, Preethi (preethi.krishnan14@gmail.com) wrote:
>  
> Hi
>  
> We are trying to setup Master slave for ActiveMQ using camel-context.  
> Our
> current architecture is like this.
>  
>  
> 1. A camel route which subscribes to MQ topics (these MQ topics  
> are IBM
> topics).
> 2. This camel route then takes the message from the topic and transforms  
> it
> 3. The transformed message is saved in the database.
>  
> I have been trying to setup master slave but have not been successful  
> so
> far. This is what I'm doing
>  
> A.An instance of this application deployed on tomcat.
> B.The slave is just another instance of this same application.Please  
> note
> that the clientids and the subscriber names are the same on both  
> these
> instances. Hence the slave would give the following exception  
> , which is
> expected.
>  
> Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT'  
> using
> MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001:  
> WebSphere MQ
> call failed with compcode '2' ('MQCC_FAILED') reason '2429'  
> ('MQRC_SUBSCRIPTION_IN_USE').
>  
>  
> We are using the default KahaDBPersistenceAdapter . The issue  
> here is that
> the slave container runs for few hours and just dies due to insufficient  
> java heap space.
> I was trying to configure the kahadb adapter to not poll every  
> 2-3 seconds ,
> which it seems to be doing , but haven't been successful so far.  
>  
> How do I configure the kahadb to poll during longer intervals  
> (say 5 mins)?
> Or are there any more options other than the kahadb for this Master  
> Slave
> setup?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360.html  
> Sent from the Camel - Users mailing list archive at Nabble.com.  
>  


Re: Master Slave Camel-ActiveMQ

Posted by James Carman <ja...@carmanconsulting.com>.
ActiveMQ or WebSphere MQ?

On Monday, December 30, 2013, Preethi wrote:

> Hi
>
> We are trying to setup Master slave for ActiveMQ using camel-context. Our
> current architecture is like this.
>
>
>    1.  A camel route which subscribes to MQ topics (these MQ topics are IBM
> topics).
>    2.  This camel route then takes the message from the topic and
> transforms
> it
>    3.  The transformed message is saved in the database.
>
> I have been trying to setup master slave but have not been successful so
> far. This is what I'm doing
>
> A.An instance of this application deployed on  tomcat.
> B.The slave is just another instance of this same application.Please note
> that the clientids and the subscriber names are the same on both these
> instances. Hence the slave would give the following exception , which is
> expected.
>
> Cause: JMSWMQ0026: Failed to subscribe to topic '#/#/ITEM/MAINT' using
> MQSUB.; nested exception is com.ibm.mq.MQException: JMSCMQ0001: WebSphere
> MQ
> call failed with compcode '2' ('MQCC_FAILED') reason '2429'
> ('MQRC_SUBSCRIPTION_IN_USE').
>
>
> We are using the default KahaDBPersistenceAdapter . The issue here is that
> the slave container runs for few hours and just dies due to insufficient
> java heap space.
> I was trying to configure the kahadb adapter to not poll every 2-3 seconds
> ,
> which it seems to be doing , but haven't been successful so far.
>
>  How do I configure the kahadb to poll during longer intervals (say 5
> mins)?
> Or are there any more options other than the kahadb for this Master Slave
> setup?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Master-Slave-Camel-ActiveMQ-tp5745360.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>