I have a routebuilder set up which sets a couple of headers on a message and
then passes that message on from queue A to queue B thus:

from ("activemq.a").setHeader("myflag",myexpression).to("activemq.b")

When I send messages with no ReplyTo set, it all works just fine.  The
messages arrive in B with their flag set appropriately.
Then I realised I had forgotten to set ReplyTo, so in my sending code I
added:
- the creation of a temp queue
- setting the replyto destination to that temp queue
- the creation of a consumer on the temp queue
- the receive call to get the answer.

Now, when I send the message various things are different/broken.  After the
message has been through the "route" and arrived at queue B we have the
following:

1)  The message has acquired an expiry time which it didn't previously have
2)  The message has been flagged as persistent (but the send mode is
non-persistent)
3)  The message has acquired a correlationID

None of these have occurred when the message arrives in A (so the routing
from A to B is making these changes).

The worst of it is that after the message expiry period passes (20 seconds
it seems) I get a java.util.concurrency.TimeoutException (stack trace at the
end of this message).  After five of these, the message is returned verbatim
to the replyTo queue and consumed.
But, it gets stranger yet...  If I put our consumer on the end of queue B
(it should consume the message and send the real reply) it appears to
receive the message five times - once each time the above noted exception
occurs.

It's possible I suppose that I'm failing to close some connection/session or
commit some send/receive operation (but I'm pretty sure I've got them all
right).  The fact that this only happens when JMSReplyTo is set throws me.

Finally, I am running on a trunk build from a day or two ago and I am
deploying my routebuilder using the newly added syntax <camelcontext>
<routeBuilderRef ref="somebean" /></camelcontext>.  I am running inside a
trunk from of AMQ from a couple of days ago also and using spring 2.0.6
rather than the 2.5.1 recently added to camel.

Any suggestions on where to start with this?  

Thanks,

-Dominic

==== Stack Trace =====

ERROR DeadLetterChannel              - Failed delivery for exchangeId:
ID-ukedfinger/4815-1201101739148/0-3. On delivery attempt: 0 caught:
java.util.concurrent.TimeoutException
java.util.concurrent.TimeoutException
        at
java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:211)
        at java.util.concurrent.FutureTask.get(FutureTask.java:85)
        at
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:99)
        at
org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsynProcessorBridge.process(AsyncProcessorTypeConverter.java:44)
        at
org.apache.camel.processor.SendProcessor.process(SendProcessor.java:73)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:143)
        at
org.apache.camel.processor.DeadLetterChannel.process(DeadLetterChannel.java:87)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:101)
        at org.apache.camel.processor.Pipeline.process(Pipeline.java:85)
        at
org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:40)
        at
org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:44)
        at
org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:68)
        at
org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:66)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:510)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:445)
        at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:414)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:309)
        at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:254)
        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:871)

        at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:818)
        at java.lang.Thread.run(Thread.java:595)
Evicting inactive request for correlationID: Entry for key:
ID-ukedfinger/4815-1201101739148/2-0
-- 
View this message in context: 
http://www.nabble.com/TimeoutException-when-using-ReplyTo--tp15043879s22882p15043879.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to