Here is my route:
<camel:endpoint id="media.retrieve.jms.inout.queue" uri="myActiveMQ:queue:RetrieveDocument?concurrentConsumers=5&replyTo=RetrieveDocument&requestTimeout=30000&disableTimeToLive=true"/>
<camel:endpoint id="media.retrieve.jms.error.queue" uri="myActiveMQ:queue:RetrieveDocument" />
<camel:endpoint id="media.retrieve.jms.processed.queue" uri="myActiveMQ:queue:RetrieveDocument" />
<camel:routeContext id="retrieveMedia">
<camel:route id="INT_DP_016-Media" routePolicyRef="routePolicy">
<camel:from uri="direct:retrieveDocument" />
<camel:onException useOriginalMessage="true">
<camel:exception>java.lang.Exception</camel:exception>
<camel:handled>
<camel:constant>false</camel:constant><!-- send exception back -->
</camel:handled>
<camel:process ref="errorHandler" />
<camel:to uri="ref:media.retrieve.jms.error.queue" />
</camel:onException>
<camel:wireTap uri="ref:media.retrieve.jms.processed.queue"/>
<camel:marshal ref="jaxbMedia" />
<camel:setProperty propertyName="outputBody">
<camel:simple resultType="java.lang.String">${body}</camel:simple>
</camel:setProperty>
<camel:setExchangePattern pattern="InOut"/>
<camel:to uri="ref:media.retrieve.jms.inout.queue" />
<camel:transacted />
<camel:process ref="mediaProcessor" />
</camel:route>
</camel:routeContext>
I receive exception (expected for my case) in my Processor (mediaProcessor) and after that should wait 20000 ms for Timeout (since sent Message wasn't received as I understand).
1) Can I immediately stop waiting and just process exception in my onException clause?
2) Why my timeout is 20 sec but not 30 sec as I set at Endpoint options?
UPDATE: Just want to clarify since it may be not clear where 20 sec timeout is raised. I have routePolicy where org.apache.camel.spi.RoutePolicy.onExchangeDone(Route, Exchange) method is invoked after 20 sec starting from the moment when my onException handler was processed:
Caused by: org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 20000 millis due reply message with correlationID: Camel-ID-michael-desktop-45995-1384079313615-1-5 not received. Exchange[Message: <?xml version="1.0" encoding="UTF-8"?>...
Why route is not finished at Exception handler? Why system still think it has some undelivered messages?