You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Eric Bouer <er...@gmail.com> on 2009/08/25 23:54:32 UTC

Replies are not consumed from reply queue.

Hello.
I'm sending messages with InOut pattern to a JMS topic and set the replyTo
to a predefined queue.
Most of the time everything works fine but...
I have a suspicious situation that under certain conditions, camel wont read
replies from that queue and fail with ExchangeTimedOutException.
I can see the reply waiting in the Queue (using AMQ web console) but camel
wont consume it.
I see that camel is holding two 2 consumers on the reply queue (camel
creates and drops them every second), but not reading the reply message from
the Queue.
How can I track that down (Using 2.0-M3)?
Many thanks.

-- 
View this message in context: http://www.nabble.com/Replies-are-not-consumed-from-reply-queue.-tp25142846p25142846.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Replies are not consumed from reply queue.

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

The default value in the JmsConfiguration is -1 (I should update the 
wiki page for it ), which means the thread will block until it get the 
message or the thread is Interrupted.
If you set the receiveTimeout value, camel will check the timeout value 
if the waiting thread is Interrupted.
So I guess setting the receiveTimeout value will help you to get back 
the reply message.

Willem

Eric Bouer wrote:
> Hi and thank you for your reply.
> I don't get it, by default receiveTimeout is set to none.
> that means no timeout isn't it ?
> 
> 
> willem.jiang wrote:
>> Hi,
>>
>> Maybe you need to set the receiveTimeout (MILLISECONDS) option on the 
>> jms endpoint to let camel wait for the response longer.
>>
>> BTW, you can check the Debug log for the exception.
>>
>>      long requestTimeout =
>> endpoint.getConfiguration().getRequestTimeout();
>>          try {
>>              Message message = null;
>>              try {
>>                  if (LOG.isDebugEnabled()) {
>>                      LOG.debug("Message sent, now waiting for reply at: 
>> " + replyTo.toString());
>>                  }
>>                  if (requestTimeout < 0) {
>>                      message = (Message)futureHolder.get().get();
>>                  } else {
>>                      message = 
>> (Message)futureHolder.get().get(requestTimeout, TimeUnit.MILLISECONDS);
>>                  }
>>              } catch (InterruptedException e) {
>>                  if (LOG.isDebugEnabled()) {
>>                      LOG.debug("Future interrupted: " + e, e);
>>                  }
>>              } catch (TimeoutException e) {
>>                  if (LOG.isDebugEnabled()) {
>>                      LOG.debug("Future timed out: " + e, e);
>>                  }
>>              }
>>
>> Willem
>>
>> Eric Bouer wrote:
>>> Hello.
>>> I'm sending messages with InOut pattern to a JMS topic and set the
>>> replyTo
>>> to a predefined queue.
>>> Most of the time everything works fine but...
>>> I have a suspicious situation that under certain conditions, camel wont
>>> read
>>> replies from that queue and fail with ExchangeTimedOutException.
>>> I can see the reply waiting in the Queue (using AMQ web console) but
>>> camel
>>> wont consume it.
>>> I see that camel is holding two 2 consumers on the reply queue (camel
>>> creates and drops them every second), but not reading the reply message
>>> from
>>> the Queue.
>>> How can I track that down (Using 2.0-M3)?
>>> Many thanks.
>>>
>>
>>
> 


Re: Replies are not consumed from reply queue.

Posted by Eric Bouer <er...@gmail.com>.
Hi and thank you for your reply.
I don't get it, by default receiveTimeout is set to none.
that means no timeout isn't it ?


willem.jiang wrote:
> 
> Hi,
> 
> Maybe you need to set the receiveTimeout (MILLISECONDS) option on the 
> jms endpoint to let camel wait for the response longer.
> 
> BTW, you can check the Debug log for the exception.
> 
>      long requestTimeout =
> endpoint.getConfiguration().getRequestTimeout();
>          try {
>              Message message = null;
>              try {
>                  if (LOG.isDebugEnabled()) {
>                      LOG.debug("Message sent, now waiting for reply at: 
> " + replyTo.toString());
>                  }
>                  if (requestTimeout < 0) {
>                      message = (Message)futureHolder.get().get();
>                  } else {
>                      message = 
> (Message)futureHolder.get().get(requestTimeout, TimeUnit.MILLISECONDS);
>                  }
>              } catch (InterruptedException e) {
>                  if (LOG.isDebugEnabled()) {
>                      LOG.debug("Future interrupted: " + e, e);
>                  }
>              } catch (TimeoutException e) {
>                  if (LOG.isDebugEnabled()) {
>                      LOG.debug("Future timed out: " + e, e);
>                  }
>              }
> 
> Willem
> 
> Eric Bouer wrote:
>> Hello.
>> I'm sending messages with InOut pattern to a JMS topic and set the
>> replyTo
>> to a predefined queue.
>> Most of the time everything works fine but...
>> I have a suspicious situation that under certain conditions, camel wont
>> read
>> replies from that queue and fail with ExchangeTimedOutException.
>> I can see the reply waiting in the Queue (using AMQ web console) but
>> camel
>> wont consume it.
>> I see that camel is holding two 2 consumers on the reply queue (camel
>> creates and drops them every second), but not reading the reply message
>> from
>> the Queue.
>> How can I track that down (Using 2.0-M3)?
>> Many thanks.
>> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Replies-are-not-consumed-from-reply-queue.-tp25142846p25149105.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Replies are not consumed from reply queue.

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

Maybe you need to set the receiveTimeout (MILLISECONDS) option on the 
jms endpoint to let camel wait for the response longer.

BTW, you can check the Debug log for the exception.

     long requestTimeout = endpoint.getConfiguration().getRequestTimeout();
         try {
             Message message = null;
             try {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Message sent, now waiting for reply at: 
" + replyTo.toString());
                 }
                 if (requestTimeout < 0) {
                     message = (Message)futureHolder.get().get();
                 } else {
                     message = 
(Message)futureHolder.get().get(requestTimeout, TimeUnit.MILLISECONDS);
                 }
             } catch (InterruptedException e) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Future interrupted: " + e, e);
                 }
             } catch (TimeoutException e) {
                 if (LOG.isDebugEnabled()) {
                     LOG.debug("Future timed out: " + e, e);
                 }
             }

Willem

Eric Bouer wrote:
> Hello.
> I'm sending messages with InOut pattern to a JMS topic and set the replyTo
> to a predefined queue.
> Most of the time everything works fine but...
> I have a suspicious situation that under certain conditions, camel wont read
> replies from that queue and fail with ExchangeTimedOutException.
> I can see the reply waiting in the Queue (using AMQ web console) but camel
> wont consume it.
> I see that camel is holding two 2 consumers on the reply queue (camel
> creates and drops them every second), but not reading the reply message from
> the Queue.
> How can I track that down (Using 2.0-M3)?
> Many thanks.
>