Hi

How do you use the interceptSendToEndpoint in your test?
Do you use adviceWith ?

Can you post how you do that?


On Thu, Dec 16, 2010 at 9:09 PM, John <[email protected]> wrote:
>
> I'm now working off 2.6-SNAPSHOT.
>
> To get around the onException/aggregate.groupBy DSL warning AND put the
> onException at the start of the route, I moved the actual send to the web
> service to it's own route. Unfortunately, I don't seem to be able to trigger
> the onException handling while testing the route. The global error handler
> kicks in after the 5 retries it is configured for.
>
> Am I doing something wrong with my onException configuration in the route?
> The code is below.
>
> Thanks,
>
> -john
>
>    errorHandler(deadLetterChannel("direct:emailSupport")
>        .maximumRedeliveries(5)
>        .redeliveryDelay(1000)
>        .backOffMultiplier(2)
>        .retryAttemptedLogLevel(LoggingLevel.WARN));
>
>    from("direct.sendToWs")
>        .routeId("sendToWs")
>
> .onException(java.net.ConnectException.class).maximumRedeliveries(-1).redeliveryDelay(30000).end()
>        .to("http:host//some_ws");
>
> In my test I created an interceptor like:
>
>    Predicate p1 = header(Exchange.REDELIVERY_COUNTER).isLessThan(7);
>    Predicate p =
> PredicateBuilder.or(header(Exchange.REDELIVERY_COUNTER).isNull(), p1);
>
>    interceptSendToEndpoint("http*")
>        .skipSendToOriginalEndpoint()
>        .choice()
>            .when(p)
>                .process(new Processor()
>                {
>                    public void process(Exchange exchange) throws Exception
>                    {
>                        System.out.println("---------------- throw
> ConnectException");
>                        throw new java.net.ConnectException();
>                    }
>                })
>            .otherwise()
>                .log("--------------- sending it on")
>                .to(postingAcceptWsEndpoint);
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/route-scoped-onException-tp3300994p3308494.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: [email protected]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to