Consumers not being redirected to ActiveMQ slave

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Consumers not being redirected to ActiveMQ slave

Bruno Borges
Hey everyone,

i'm doing some things with Camel and ActiveMQ, and it looks like consumers
from Camel (using activemq:) are not being redirected (not reconnecting) to
an ActiveMQ slave after the master has gone down.

This is the configuration I'm using:

  <bean id="jmsConnectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <!-- Verifique o arquivo de hosts da maquin aonde esta aplicacao esta
rodando. -->
    <property
name="brokerURL"
value="failover:(nio://activemq01:61616,nio://activemq02:61616)"
/>
  </bean>

  <bean id="pooledConnectionFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
    <property name="maxConnections" value="8" />
    <property name="maximumActive" value="500" />
    <property name="connectionFactory" ref="jmsConnectionFactory" />
  </bean>

  <bean id="jmsConfig"
class="org.apache.camel.component.jms.JmsConfiguration">
    <property name="connectionFactory" ref="pooledConnectionFactory" />
    <property name="transacted" value="false" />
    <property name="concurrentConsumers" value="5" />
    <property name="disableReplyTo" value="true" />
    <property name="preserveMessageQos" value="true" />
  </bean>

  <bean id="activemq"
class="org.apache.activemq.camel.component.ActiveMQComponent">
    <property name="configuration" ref="jmsConfig" />
  </bean>

Any idea?

*Bruno Borges*
(11) 99564-9058
*www.brunoborges.com*
Reply | Threaded
Open this post in threaded view
|

Re: Consumers not being redirected to ActiveMQ slave

Bruno Borges
I think the problem relies on the use of PooledConnectionFactory, where it keeps connections.

Connection objects to the old broker are still inside the pool, and running "forever".

Maybe they are not being released after some timeout?
Reply | Threaded
Open this post in threaded view
|

Re: Consumers not being redirected to ActiveMQ slave

Christian Mueller
Administrator
Which version of Camel and ActiveMQ do you use?

Best,
Christian

On Wed, Aug 1, 2012 at 10:07 PM, Bruno Borges <[hidden email]>wrote:

> I think the problem relies on the use of PooledConnectionFactory, where it
> keeps connections.
>
> Connection objects to the old broker are still inside the pool, and running
> "forever".
>
> Maybe they are not being released after some timeout?
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Consumers-not-being-redirected-to-ActiveMQ-slave-tp5716671p5716672.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
Reply | Threaded
Open this post in threaded view
|

Re: Consumers not being redirected to ActiveMQ slave

Christian Mueller
Administrator
In reply to this post by Bruno Borges
How did you test this hehavior?

Sent from a mobile device
Am 01.08.2012 22:00 schrieb "Bruno Borges" <[hidden email]>:

> Hey everyone,
>
> i'm doing some things with Camel and ActiveMQ, and it looks like consumers
> from Camel (using activemq:) are not being redirected (not reconnecting) to
> an ActiveMQ slave after the master has gone down.
>
> This is the configuration I'm using:
>
>   <bean id="jmsConnectionFactory"
> class="org.apache.activemq.ActiveMQConnectionFactory">
>     <!-- Verifique o arquivo de hosts da maquin aonde esta aplicacao esta
> rodando. -->
>     <property
> name="brokerURL"
> value="failover:(nio://activemq01:61616,nio://activemq02:61616)"
> />
>   </bean>
>
>   <bean id="pooledConnectionFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
>     <property name="maxConnections" value="8" />
>     <property name="maximumActive" value="500" />
>     <property name="connectionFactory" ref="jmsConnectionFactory" />
>   </bean>
>
>   <bean id="jmsConfig"
> class="org.apache.camel.component.jms.JmsConfiguration">
>     <property name="connectionFactory" ref="pooledConnectionFactory" />
>     <property name="transacted" value="false" />
>     <property name="concurrentConsumers" value="5" />
>     <property name="disableReplyTo" value="true" />
>     <property name="preserveMessageQos" value="true" />
>   </bean>
>
>   <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>     <property name="configuration" ref="jmsConfig" />
>   </bean>
>
> Any idea?
>
> *Bruno Borges*
> (11) 99564-9058
> *www.brunoborges.com*
>
Reply | Threaded
Open this post in threaded view
|

Re: Consumers not being redirected to ActiveMQ slave

Bruno Borges
versions: 2.10 / 5.6.0

We kill the master (HUP)

Then slave takes control of ActiveMQ's data (over NFSv4).

Camel consumers are not recreated.

We check the ActiveMQ console and there's no consumer on any queue.

*Bruno Borges*
(11) 99564-9058
*www.brunoborges.com*



On Thu, Aug 2, 2012 at 6:52 PM, Christian Müller <
[hidden email]> wrote:

> How did you test this hehavior?
>
> Sent from a mobile device
> Am 01.08.2012 22:00 schrieb "Bruno Borges" <[hidden email]>:
>
> > Hey everyone,
> >
> > i'm doing some things with Camel and ActiveMQ, and it looks like
> consumers
> > from Camel (using activemq:) are not being redirected (not reconnecting)
> to
> > an ActiveMQ slave after the master has gone down.
> >
> > This is the configuration I'm using:
> >
> >   <bean id="jmsConnectionFactory"
> > class="org.apache.activemq.ActiveMQConnectionFactory">
> >     <!-- Verifique o arquivo de hosts da maquin aonde esta aplicacao esta
> > rodando. -->
> >     <property
> > name="brokerURL"
> > value="failover:(nio://activemq01:61616,nio://activemq02:61616)"
> > />
> >   </bean>
> >
> >   <bean id="pooledConnectionFactory"
> > class="org.apache.activemq.pool.PooledConnectionFactory">
> >     <property name="maxConnections" value="8" />
> >     <property name="maximumActive" value="500" />
> >     <property name="connectionFactory" ref="jmsConnectionFactory" />
> >   </bean>
> >
> >   <bean id="jmsConfig"
> > class="org.apache.camel.component.jms.JmsConfiguration">
> >     <property name="connectionFactory" ref="pooledConnectionFactory" />
> >     <property name="transacted" value="false" />
> >     <property name="concurrentConsumers" value="5" />
> >     <property name="disableReplyTo" value="true" />
> >     <property name="preserveMessageQos" value="true" />
> >   </bean>
> >
> >   <bean id="activemq"
> > class="org.apache.activemq.camel.component.ActiveMQComponent">
> >     <property name="configuration" ref="jmsConfig" />
> >   </bean>
> >
> > Any idea?
> >
> > *Bruno Borges*
> > (11) 99564-9058
> > *www.brunoborges.com*
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Consumers not being redirected to ActiveMQ slave

Christian Mueller
Administrator
Do you still experience this issue with Camel 2.10.3 and ActiveMQ 5.7.0?
Could you change from "nio" to "tcp" and check whether do you still have
this issue.

Best,
Christian

On Thu, Aug 2, 2012 at 11:57 PM, Bruno Borges <[hidden email]>wrote:

> recreated




--