6 Replies Latest reply on Nov 19, 2012 11:59 AM by Łukasz Dywicki

    Camel RouteBuilder onException statement II

    Eduardo de Vera Toquero Newbie

      I managed to make the onException statement work on previous versions of SwitchYard, unfortunately I'm unable to make it work on the current release.

       

      I am trying a dead simple route such as:

       

      {code}

      public void configure() throws Exception {

       

              from(inputService)

                  .onException(TransactionalException.class)

                          .maximumRedeliveries(3)

                          .handled(true)

                          .log("Exception handled")

                          .to(exceptionService)

                          .end()

                  .to(businessService)

                  .to(outputService);

          }

       

      {code}

       

      I have created a businessService that throws exceptions if the payload is such as:

       

      {code}

      @Service(name = "BeanService", value = ITransactionalBean.class)

      public class TransactionalBeanImpl implements ITransactionalBean {

       

       

          public static final String EXCEPTION_PAYLOAD = "exception";

       

       

          @Override

          public void sayHello(String name) throws TransactionalException {

              if (EXCEPTION_PAYLOAD.equals(name)) {

                  throw new TransactionalException("Exception thrown from TransactionalBeanImpl");

              }

              System.out.println("Hello: "+name);

          }

      }

      {code}

       

      When I run the code with a CamelTestSupport test case, then it RouteBuilder behaves as expected.

       

      Unfortunately, when I run it with a SwitchYardRunner.class having initialized everything correctly, when trying to simulate the exception, the application does not behave as expected. There isn't any exception logged and it seems as if the Exception was lost and the route continues normally.

       

      For more information, you can find a working example here: https://github.com/etux/quickstarts/tree/camel-transactional-binding/camel-binding-transactional

        • 1. Re: Camel RouteBuilder onException statement II
          Łukasz Dywicki Novice

          Hey Eduardo,

          I am afraid that after work I've done on SWITCHYARD-1143 I catch the exception before you can handle it. Keith pushed these changes to master few days ago.. I'll investigate this problem.

          • 2. Re: Camel RouteBuilder onException statement II
            Keith Babo Master

            Eduardo - when you say "current release" are you referring to 0.6.0 Final or the 0.7.0-SNAPSHOT nightly build?  The change Lukasz mentioned above should only be in the nightly build.

            • 3. Re: Camel RouteBuilder onException statement II
              Eduardo de Vera Toquero Newbie

              I am talking about 0.6.0.Final. So I think the changes from Lukazs are not included in this release.

              • 4. Re: Camel RouteBuilder onException statement II
                Keith Babo Master

                Saw the discussion around this on IRC and figured I would post a few details back here to the forum for everyone's benefit.

                 

                Strictly speaking, the following interface definition is not handled appropriately in our Java metadata parser:

                 

                 

                public void sayHello(String name) throws TransactionalException

                 

                 

                It's currently parsed as InOnly, which is not accurate as InOnly services can't return a fault.  We should either throw an error, parse this an InOut (with asssumed null reply), or support the equivalent to a RobustInOnly pattern.

                 

                You mentioned you get a different error when you add a return type to the operation, which forces the MEP to InOut.  I think we should chase that down first and figure out what the error is there, which is likely to occur with whatever resolution we choose above.

                • 5. Re: Camel RouteBuilder onException statement II
                  Eduardo de Vera Toquero Newbie

                  Just for the record, having changed from a void method to one returning an object has made the onException from Camel work but with a side effect. Since I am diverting the message to a queue which by default is InOnly, Camel waits for an answer, producing the following output:

                   

                  17:01:47,852 INFO  [route2] Exception handled

                  17:01:48,838 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Starting to graceful shutdown 1 routes (timeout 300 seconds)

                  17:01:48,839 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 300 seconds.

                  17:01:49,840 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 299 seconds.

                  17:01:50,842 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 298 seconds.

                  17:01:51,843 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 297 seconds.

                  17:01:52,843 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 296 seconds.

                  17:01:53,844 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 295 seconds.

                  17:01:54,845 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 294 seconds.

                  17:01:55,847 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 293 seconds.

                  17:01:56,848 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 292 seconds.

                  17:01:57,849 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 291 seconds.

                  17:01:58,851 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 290 seconds.

                  17:01:59,852 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 289 seconds.

                  17:02:00,854 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 288 seconds.

                  17:02:01,855 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 287 seconds.

                  17:02:02,856 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 286 seconds.

                  17:02:03,857 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 285 seconds.

                  17:02:04,858 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 284 seconds.

                  17:02:05,859 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 283 seconds.

                  17:02:06,859 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 282 seconds.

                  17:02:07,860 INFO  [org.apache.camel.impl.DefaultShutdownStrategy] Waiting as there are still 1 inflight and pending exchanges to complete, timeout in 281 seconds.

                  17:02:07,875 WARN  [org.apache.camel.component.jms.reply.TemporaryQueueReplyManager] Timeout occurred after 20000 millis waiting for reply message with correlationID [ID-macbookpro-55898-1353340881793-3-17]. Setting ExchangeTimedOutException on (MessageId: ID-macbookpro-55898-1353340881793-3-16 on ExchangeId: ID-macbookpro-55898-1353340881793-3-18) and continue routing.

                  17:02:07,878 ERROR [org.apache.camel.processor.FatalFallbackErrorHandler] Exception occurred while trying to handle previously thrown exception on exchangeId: ID-macbookpro-55898-1353340881793-3-5 using: [Pipeline[[Channel[Log(route2)[Exception handled]], Channel[sendTo(Endpoint[switchyard://ExceptionService?namespace=urn%3Aswitchyard%3Aquickstarts%3Acamel_transactional_binding%3A1.0])]]]]. The previous and the new exception will be logged in the following.

                  17:02:07,878 ERROR [org.apache.camel.processor.FatalFallbackErrorHandler] \--> Previous exception on exchangeId: ID-macbookpro-55898-1353340881793-3-5

                  org.switchyard.quickstarts.camel.impl.TransactionalException: Exception thrown from TransactionalBeanImpl

                            at org.switchyard.quickstarts.camel.impl.TransactionalBeanImpl.sayHello(TransactionalBeanImpl.java:20)

                            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                            at java.lang.reflect.Method.invoke(Method.java:597)

                            at org.switchyard.component.bean.ServiceProxyHandler.handle(ServiceProxyHandler.java:130)

                            at org.switchyard.component.bean.ServiceProxyHandler.handleMessage(ServiceProxyHandler.java:89)

                            at org.switchyard.bus.camel.processors.ProviderProcessor.process(ProviderProcessor.java:39)

                            at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:58)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)

                            at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)

                            at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)

                            at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)

                            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)

                            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)

                            at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)

                            at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)

                            at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:169)

                            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)

                            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:97)

                            at org.switchyard.bus.camel.ExchangeDispatcher.dispatch(ExchangeDispatcher.java:64)

                            at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:199)

                            at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:114)

                            at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:104)

                            at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:120)

                            at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:292)

                            at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:115)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)

                            at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)

                            at org.switchyard.component.camel.SwitchYardConsumer.invokeCamelProcessor(SwitchYardConsumer.java:93)

                            at org.switchyard.component.camel.SwitchYardConsumer.handleMessage(SwitchYardConsumer.java:64)

                            at org.switchyard.bus.camel.processors.ProviderProcessor.process(ProviderProcessor.java:39)

                            at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.switchyard.bus.camel.audit.FaultProcessor.process(FaultProcessor.java:58)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:117)

                            at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:122)

                            at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61)

                            at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)

                            at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)

                            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:360)

                            at org.apache.camel.impl.ProducerCache$2.doInProducer(ProducerCache.java:331)

                            at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:227)

                            at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:331)

                            at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:169)

                            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:111)

                            at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:97)

                            at org.switchyard.bus.camel.ExchangeDispatcher.dispatch(ExchangeDispatcher.java:64)

                            at org.switchyard.internal.ExchangeImpl.sendInternal(ExchangeImpl.java:199)

                            at org.switchyard.internal.ExchangeImpl.send(ExchangeImpl.java:114)

                            at org.switchyard.component.camel.SwitchYardProducer.process(SwitchYardProducer.java:104)

                            at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.SendProcessor$2.doInAsyncProducer(SendProcessor.java:120)

                            at org.apache.camel.impl.ProducerCache.doInAsyncProducer(ProducerCache.java:292)

                            at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:115)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:98)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:111)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:91)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:56)

                            at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:330)

                            at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:220)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.processByErrorHandler(TransactionErrorHandler.java:220)

                            at org.apache.camel.spring.spi.TransactionErrorHandler$1.doInTransactionWithoutResult(TransactionErrorHandler.java:180)

                            at org.springframework.transaction.support.TransactionCallbackWithoutResult.doInTransaction(TransactionCallbackWithoutResult.java:33)

                            at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.doInTransactionTemplate(TransactionErrorHandler.java:173)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.processInTransaction(TransactionErrorHandler.java:133)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:102)

                            at org.apache.camel.spring.spi.TransactionErrorHandler.process(TransactionErrorHandler.java:111)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.interceptor.DefaultChannel.process(DefaultChannel.java:303)

                            at org.apache.camel.processor.RouteContextProcessor.processNext(RouteContextProcessor.java:45)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.processor.UnitOfWorkProcessor.processAsync(UnitOfWorkProcessor.java:150)

                            at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:117)

                            at org.apache.camel.processor.RouteInflightRepositoryProcessor.processNext(RouteInflightRepositoryProcessor.java:48)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:73)

                            at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:90)

                            at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:73)

                            at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:99)

                            at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:86)

                            at org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:104)

                            at org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:560)

                            at org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:498)

                            at org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:467)

                            at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)

                            at org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:243)

                            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1058)

                            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1050)

                            at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:947)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                            at java.lang.Thread.run(Thread.java:680)

                  17:02:07,906 ERROR [org.apache.camel.processor.FatalFallbackErrorHandler] \--> New exception on exchangeId: ID-macbookpro-55898-1353340881793-3-5

                  org.apache.camel.ExchangeTimedOutException: The OUT message was not received within: 20000 millis due reply message with correlationID: ID-macbookpro-55898-1353340881793-3-17 not received. Exchange[Message: exception]

                            at org.apache.camel.component.jms.reply.ReplyManagerSupport.processReply(ReplyManagerSupport.java:133)

                            at org.apache.camel.component.jms.reply.TemporaryQueueReplyHandler.onTimeout(TemporaryQueueReplyHandler.java:61)

                            at org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:53)

                            at org.apache.camel.component.jms.reply.CorrelationTimeoutMap.onEviction(CorrelationTimeoutMap.java:30)

                            at org.apache.camel.support.DefaultTimeoutMap.purge(DefaultTimeoutMap.java:203)

                            at org.apache.camel.support.DefaultTimeoutMap.run(DefaultTimeoutMap.java:159)

                            at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)

                            at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

                            at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

                            at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                            at java.lang.Thread.run(Thread.java:680)

                  • 6. Re: Camel RouteBuilder onException statement II
                    Łukasz Dywicki Novice

                    Eduardo,

                    This is caused due danger mix of in-only bindings (default behavior for JMS) and in-out requirements (exception processing).
                    I am able to make your demo running with following changes:

                    • Change interface type to in-out - as sugessted by Keith - by returning some value from service call
                    • Disable replyTo for ExceptionService by setting parameter
                      <camel:disableReplyTo>true</camel:disableReplyTo>
                      

                    These two changes allows to complete exception scenario you have with 0.6.
                    Best regards,

                    Lukasz