Charles can you attach / post your interceptor logic in the JIRA ticket?
If there is company sensitive information in it, then remove/change the stuff. I just wanna see how you have created the interceptor stuff. On Thu, Aug 12, 2010 at 1:12 PM, Charles Moulliard <[email protected]> wrote: > It works fine if I remove the intercept strategy in the camel route > > // getContext().addInterceptStrategy( > // new AuditInterceptStrategy(getRepository())); > > Here is the trace about what the mock:error endpoint receive > > 35531 [main] INFO org.apache.camel.component.mock.MockEndpoint - Asserting: > Endpoint[mock://error] is satisfied > PROPERTIES ERROR: {CamelToEndpoint=mock://error, > CamelFailureEndpoint=direct://start, > CamelExceptionCaught=org.fusesource.esb.audit.testsupport.MockOrderService$OrderFail > edException: Cannot order: fail} > > > On Thu, Aug 12, 2010 at 1:00 PM, Claus Ibsen <[email protected]> wrote: > >> And it only occurs when you use the intercept strategy? If you remove >> it, does it work then? Sending to the mock:error endpoint? >> >> >> On Thu, Aug 12, 2010 at 12:50 PM, Charles Moulliard >> <[email protected]> wrote: >> > Hi, >> > >> > We get the following error when we try to use the following camel route + >> > test >> > Is it a bad configuration or a bug ? >> > >> > 1) Error >> > >> > 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: >> route1 >> > started and consuming from: Endpoint[direct://in-only] >> > 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: >> route2 >> > started and consuming from: Endpoint[direct://start] >> > 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Route: >> route3 >> > started and consuming from: Endpoint[direct://file] >> > 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Started 3 >> > routes >> > 40781 [main] INFO org.apache.camel.impl.DefaultCamelContext - Apache >> Camel >> > 2.4.0 (CamelContext: camel-1) started in 0.000 seconds >> > 40781 [main] INFO org.apache.jackrabbit.core.TransientRepository - >> Session >> > opened >> > 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > Processing Exchange >> > 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node >> > path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5 >> > 40797 [main] INFO org.apache.jackrabbit.core.TransientRepository - >> Session >> > opened >> > 40797 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > ENDPOINT: direct >> > OrderFailedExeption: Cannot order: fail >> > 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > Processing Exchange >> > 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node >> > path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5 >> > 40938 [main] INFO org.apache.jackrabbit.core.TransientRepository - >> Session >> > opened >> > 40938 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > ENDPOINT: direct >> > Order ERROR >> > 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > Processing Exchange >> > 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - Node >> > path - Active Exchange: a23af01b-64a6-49c7-80c9-15177d945ee5 >> > 41000 [main] INFO org.apache.jackrabbit.core.TransientRepository - >> Session >> > opened >> > 41000 [main] INFO org.fusesource.esb.audit.camel.AuditInterceptor - >> > ENDPOINT: direct >> > 41047 [main] ERROR org.apache.camel.processor.DefaultErrorHandler - >> Failed >> > delivery for exchangeId: a23af01b-64a6-49c7-80c9-15177d945ee5. Exhausted >> > after delivery attempt >> > : 1 caught: java.lang.IllegalStateException: SendProcessor has not been >> > started: sendTo(Endpoint[mock://error]) >> > java.lang.IllegalStateException: SendProcessor has not been started: >> > sendTo(Endpoint[mock://error]) >> > at >> > org.apache.camel.processor.SendProcessor.process(SendProcessor.java:94) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at >> > >> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) >> > at >> > >> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) >> > at >> > >> org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99) >> > at >> > >> org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:67) >> > at >> > >> org.apache.camel.processor.DelegateProcessor.processNext(DelegateProcessor.java:58) >> > at >> > >> org.apache.camel.processor.DelegateProcessor.proceed(DelegateProcessor.java:90) >> > at >> > >> org.fusesource.esb.audit.camel.AuditInterceptor.process(AuditInterceptor.java:78) >> > at >> > >> org.apache.camel.impl.converter.AsyncProcessorTypeConverter$ProcessorToAsyncProcessorBridge.process(AsyncProcessorTypeConverter.java:50) >> > at >> > >> org.apache.camel.processor.InterceptorToAsyncProcessorBridge.process(InterceptorToAsyncProcessorBridge.java:76) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at >> > >> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:290) >> > at >> > >> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202) >> > at >> > >> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at org.apache.camel.processor.Pipeline.process(Pipeline.java:143) >> > at org.apache.camel.processor.Pipeline.process(Pipeline.java:78) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at >> > >> org.apache.camel.processor.RedeliveryErrorHandler.deliverToFailureProcessor(RedeliveryErrorHandler.java:582) >> > at >> > >> org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:236) >> > at >> > >> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:202) >> > at >> > >> org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:256) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at org.apache.camel.processor.Pipeline.process(Pipeline.java:143) >> > at org.apache.camel.processor.Pipeline.process(Pipeline.java:78) >> > at >> > >> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:113) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at >> > >> org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98) >> > at >> > >> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89) >> > at >> > >> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:70) >> > at >> > >> org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:61) >> > at >> > >> org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99) >> > at >> > >> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91) >> > at >> > >> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85) >> > at >> > >> org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63) >> > at >> > >> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:333) >> > at >> > >> org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:304) >> > at >> > org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:208) >> > at >> > org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:303) >> > at >> org.apache.camel.impl.ProducerCache.send(ProducerCache.java:154) >> > at >> > >> org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:110) >> > at >> > >> org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:149) >> > at >> > >> org.apache.camel.impl.DefaultProducerTemplate.sendBodyAndHeader(DefaultProducerTemplate.java:145) >> > at >> > >> org.fusesource.esb.audit.camel.AuditInterceptorWithInOnlyTest.testInOnlyWithErrorHandler(AuditInterceptorWithInOnlyTest.java:55) >> > >> > 2) Camel route >> > >> > protected RouteBuilder createRouteBuilder() throws Exception { >> > return new RouteBuilder() { >> > �...@override >> > public void configure() throws Exception { >> > >> > getContext().addInterceptStrategy( >> > new AuditInterceptStrategy(getRepository())); >> > >> onException(OrderFailedException.class).handled(true).bean( >> > MockOrderService.class, >> > "orderFailed").to("mock:error"); >> > // let's not handle any runtime exceptions >> > onException(RuntimeCamelException.class).handled(false); >> > >> > from("direct:in-only").to("mock:in-only"); >> > >> > errorHandler(deadLetterChannel("mock:error") >> > .maximumRedeliveries(1)); >> > from("direct:start") >> > .bean(MockOrderService.class, "handleOrder").to( >> > "mock:result"); >> > from("direct:file").to("mock:file").throwException( >> > new RuntimeCamelException( >> > "Something is completely going wrong >> > here!")); >> > } >> > }; >> > } >> > >> > 3) test code >> > >> > public void testInOnlyWithErrorHandler() throws Exception { >> > >> > MockEndpoint error = getMockEndpoint("mock:error"); >> > error.expectedMessageCount(1); >> > MockEndpoint result = getMockEndpoint("mock:result"); >> > result.expectedMessageCount(0); >> > template.sendBodyAndHeader("direct:start", "Order: fail", >> > "customerid", "555"); = line 55 where error is reported >> > >> > error.assertIsSatisfied(); >> > result.assertIsSatisfied(); >> > >> > Exchange exchange = error.getExchanges().get(0); >> > System.out.println("PROPERTIES ERROR: " + >> > exchange.getProperties().toString()); >> > assertStatus(exchange, ExchangeStatus.Done.toString()); >> > >> > } >> > >> > Kind regards, >> > >> > Charles Moulliard >> > >> > Senior Enterprise Architect (J2EE, .NET, SOA) >> > Apache Camel - Karaf - ServiceMix Committer >> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> > Blog : http://cmoulliard.blogspot.com | Twitter : >> > http://twitter.com/cmoulliard >> > Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: >> cmoulliard >> > >> >> >> >> -- >> Claus Ibsen >> Apache Camel Committer >> >> Author of Camel in Action: http://www.manning.com/ibsen/ >> Open Source Integration: http://fusesource.com >> Blog: http://davsclaus.blogspot.com/ >> Twitter: http://twitter.com/davsclaus >> > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
