You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Michael La Budde <pa...@hotmail.com> on 2010/12/21 19:48:27 UTC

Camel stops listening to Queue

Hi all:

Here is what I am experiencing: 

After a period of time Camel stops pulling messages off a queue and ActiveMQ moves them to the DLQ.

Environment:

Camel 2.4.0
Spring 3.0.5
ActiveMQ 5.3.1

My Camel/Spring applications run inside JBoss on linux servers.

The client application uses ProducerTemplate.requestBody(dest, xml) to send an InOut message. The destination is something like: 

"activemq:MyCompany.CAM"

The route on the server side looks like this:

<route>
  <from uri="activemq:MyCompany.CAM?concurrentConsumers=2"/>
   <choice>
    <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userAssociated']</xpath>
      <to uri="bean:associateUser"/>
    </when>
    <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userChanged']</xpath>
      <to uri="bean:changeUser"/>
    </when>
    <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='checkAccount']</xpath>
      <to uri="bean:checkAccount"/>
    </when>
    <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='createUser']</xpath>
      <to uri="bean:createUser"/>
    </when>
    <otherwise>
        <to uri="bean:unknownMessage"/>
    </otherwise>
  </choice>
</route>

Each bean implements the Processor interface and typically has only that one method.

Everything works well for awhile - but then the InOut messages are no longer received. 
They get published to ActiveMQ properly but after the 20 second timeout (the default) they get moved to the DLQ.

Before I write a servlet to handle the synchronous requests I thought I'd check here to see if anyone could shed some light on what is going on and how I can fix it.

TIA,

Mike L. (aka patzerbud)

 		 	   		  

RE: Camel stops listening to Queue

Posted by Michael La Budde <pa...@hotmail.com>.
> 
> PS: There are two servers running the server side of this - both will be monitoring the same Queue for the InOut messages. I can switch off one of the servers and see if that makes any difference...
> 

Well, turning off one of the two servers seems to have fixed the issue. I have not been able to reproduce it.

So, why would having multiple servers (and multiple consumers) listening on a queue result in InOut messages not being processed?

Is there some configuration setting I'm missing?

Should I be using an exclusive consumer to process InOut messages?

Any help would be greatly appreciated.

TIA,

Mike L. (aka patzerbud)

 		 	   		  

RE: Camel stops listening to Queue

Posted by Michael La Budde <pa...@hotmail.com>.
Thank you for your response. Yes, we are experiencing TimeoutExceptions when the server fails to respond within the (default) 20 seconds to an InOut message. 
I had high hopes that this would fix the issue - alas, it did not. 

Here is the connection string I'm using:

failover:(tcp://10.0.33.118:61616?keepAlive=true&trace=true,tcp://10.0.33.119:61616?keepAlive=true&trace=true)?randomize=false

This morning I changed the server application to use this:

tcp://10.0.33.118:61616?keepAlive=true&trace=true

Initial tests looked promising but then, once again, we have experienced the same Timeouts. Here's a partial stack trace: 

Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 20000 millis. Exchange[Message: <?xml version="1.0" encoding="UTF-8"?> ...snip...

I'm really at a loss as to what's happening and how to resolve this issue.

In order to gain some visibility I'm ready to enable debug logging for
org.apache.camel
org.springframework
org.apache.activemq

Any thoughts/information/suggestions would be most welcome!

TIA,

Mike L. (aka patzerbud)

PS: There are two servers running the server side of this - both will be monitoring the same Queue for the InOut messages. I can switch off one of the servers and see if that makes any difference...

> 
> Is it timing out?
> Have you tried specifying a keep alive parameter to activemq?
>     val activeMqConnection = "tcp://localhost:61616?keepAlive=true"
> 
> -
> @tommychheng
> http://tommy.chheng.com
> 
> On Tue, Dec 21, 2010 at 10:48 AM, Michael La Budde <pa...@hotmail.com>wrote:
> 
> >
> > Hi all:
> >
> > Here is what I am experiencing:
> >
> > After a period of time Camel stops pulling messages off a queue and
> > ActiveMQ moves them to the DLQ.
> >
> > Environment:
> >
> > Camel 2.4.0
> > Spring 3.0.5
> > ActiveMQ 5.3.1
> >
> > My Camel/Spring applications run inside JBoss on linux servers.
> >
> > The client application uses ProducerTemplate.requestBody(dest, xml) to send
> > an InOut message. The destination is something like:
> >
> > "activemq:MyCompany.CAM"
> >
> > The route on the server side looks like this:
> >
> > <route>
> >  <from uri="activemq:MyCompany.CAM?concurrentConsumers=2"/>
> >   <choice>
> >
> >  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userAssociated']</xpath>
> >      <to uri="bean:associateUser"/>
> >    </when>
> >
> >  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userChanged']</xpath>
> >      <to uri="bean:changeUser"/>
> >    </when>
> >
> >  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='checkAccount']</xpath>
> >      <to uri="bean:checkAccount"/>
> >    </when>
> >
> >  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='createUser']</xpath>
> >      <to uri="bean:createUser"/>
> >    </when>
> >    <otherwise>
> >        <to uri="bean:unknownMessage"/>
> >    </otherwise>
> >  </choice>
> > </route>
> >
> > Each bean implements the Processor interface and typically has only that
> > one method.
> >
> > Everything works well for awhile - but then the InOut messages are no
> > longer received.
> > They get published to ActiveMQ properly but after the 20 second timeout
> > (the default) they get moved to the DLQ.
> >
> > Before I write a servlet to handle the synchronous requests I thought I'd
> > check here to see if anyone could shed some light on what is going on and
> > how I can fix it.
> >
> > TIA,
> >
> > Mike L. (aka patzerbud)
> >
> >
 		 	   		  

Re: Camel stops listening to Queue

Posted by Tommy Chheng <to...@gmail.com>.
Is it timing out?
Have you tried specifying a keep alive parameter to activemq?
    val activeMqConnection = "tcp://localhost:61616?keepAlive=true"

-
@tommychheng
http://tommy.chheng.com

On Tue, Dec 21, 2010 at 10:48 AM, Michael La Budde <pa...@hotmail.com>wrote:

>
> Hi all:
>
> Here is what I am experiencing:
>
> After a period of time Camel stops pulling messages off a queue and
> ActiveMQ moves them to the DLQ.
>
> Environment:
>
> Camel 2.4.0
> Spring 3.0.5
> ActiveMQ 5.3.1
>
> My Camel/Spring applications run inside JBoss on linux servers.
>
> The client application uses ProducerTemplate.requestBody(dest, xml) to send
> an InOut message. The destination is something like:
>
> "activemq:MyCompany.CAM"
>
> The route on the server side looks like this:
>
> <route>
>  <from uri="activemq:MyCompany.CAM?concurrentConsumers=2"/>
>   <choice>
>
>  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userAssociated']</xpath>
>      <to uri="bean:associateUser"/>
>    </when>
>
>  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='userChanged']</xpath>
>      <to uri="bean:changeUser"/>
>    </when>
>
>  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='checkAccount']</xpath>
>      <to uri="bean:checkAccount"/>
>    </when>
>
>  <when><xpath>/MyCompanyMessage/MessageHeader[MessageType='createUser']</xpath>
>      <to uri="bean:createUser"/>
>    </when>
>    <otherwise>
>        <to uri="bean:unknownMessage"/>
>    </otherwise>
>  </choice>
> </route>
>
> Each bean implements the Processor interface and typically has only that
> one method.
>
> Everything works well for awhile - but then the InOut messages are no
> longer received.
> They get published to ActiveMQ properly but after the 20 second timeout
> (the default) they get moved to the DLQ.
>
> Before I write a servlet to handle the synchronous requests I thought I'd
> check here to see if anyone could shed some light on what is going on and
> how I can fix it.
>
> TIA,
>
> Mike L. (aka patzerbud)
>
>