Hi Nathan,

When you use the doTry, doCatch processors, they will handle the exceptions
instead of the interceptor (= onException).

Regards,


On Wed, Oct 15, 2014 at 9:36 PM, nathanwray <nab...@detroitsci.com> wrote:

> Hi all;
>
> I have a global onException defined that I hoped would let me retry an
> entire route twice using a setup like the following.  The issue that I see
> is that route2 gets called an unlimited number of times until it succeeds.
>
> Is this due to route2 having a doTry block inside?  Or am I missing
> something else?
>
> <onException useOriginalMessage="true">
> <exception>org.apache.camel.ExchangeTimedOutException</exception>
> <redeliveryPolicy maximumRedeliveries="2" redeliveryDelay="0"/>
> <continued><constant>true</constant></continued>
> <transform>//set an appropriate error result body
> </transform>
> </onException>
>
> from route1, I call into route2:
>
> <route id="1">
> <to uri="direct:route2"/>
> </route>
>
> <route id="2" errorHandlerRef="disableErrorHandler">
> <doTry>
> //call a jetty route
> <doCatch>
> <exception>java.lang.Exception</exception>
> <handled><constant>false</constant></handled>
> // log some info into the database
> </doCatch>
> </doTry>
> </route>
>
> I see logging like the following:
>
> 2014-10-15 15:00:14,469 [CamelJettyClient(0xf6eec8e)-150] WARN
> jetty.client.HttpExchange EXPIRED JettyContentExchange@50e9cd46=POST// a
> url
> here #SENDING(1ms)->EXPIRED(0ms)sent=1ms
>
> 2014-10-15 15:00:14,470 [CamelJettyClient(0xf6eec8e)-150] ERROR
> route.vendor-md.doCatch Exception
> org.apache.camel.ExchangeTimedOutException: The OUT message was not
> received
> within: 100 millis. Exchange[Message:  a JSON message body here]
>         at
>
> org.apache.camel.component.jetty.JettyContentExchange.doTaskCompleted(JettyContentExchange.java:207)
>         at
>
> org.apache.camel.component.jetty.JettyContentExchange.onExpire(JettyContentExchange.java:130)
>         at
>
> org.eclipse.jetty.client.HttpExchange$Listener.onExpire(HttpExchange.java:1120)
>         at
>
> org.eclipse.jetty.client.HttpExchange.setStatusExpired(HttpExchange.java:384)
>         at
> org.eclipse.jetty.client.HttpExchange.setStatus(HttpExchange.java:267)
>         at
> org.eclipse.jetty.client.HttpExchange.expire(HttpExchange.java:130)
>         at
> org.eclipse.jetty.client.HttpExchange$1.expired(HttpExchange.java:1070)
>         at org.eclipse.jetty.util.thread.Timeout.tick(Timeout.java:140)
>         at org.eclipse.jetty.util.thread.Timeout.tick(Timeout.java:153)
>         at org.eclipse.jetty.client.HttpClient$1.run(HttpClient.java:441)
>         at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>         at
>
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>         at java.lang.Thread.run(Thread.java:745)
>
> 2014-10-15 15:00:14,474 [Camel (camel-1) thread #10 -
> ErrorHandlerRedeliveryTask] DEBUG route2  a debugging message here from
> route2
>
>
> Any thoughts?
>
>
>
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/onException-and-doTry-tp5757602.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Charles Moulliard
Apache Committer / Architect @RedHat
Twitter : @cmoulliard | Blog :  http://cmoulliard.github.io

Reply via email to