camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dariusz.skrudlik" <>
Subject How catch exception with endpoint was created dynamicly
Date Fri, 09 Aug 2013 14:13:49 GMT
I found a lot of post about that, but any working for me.

I have tested options
- throwExceptionOnConnectFailed
- consumer.bridgeErrorHandler
- pollStrategy

I have spring bean where define route:

public class MyRouteRunner {

    CamelContext camelContext;

    public void startRoute( /* some arguments */) {

        route =

        Exchange exchange = null;
        ConsumerTemplate consumerTemplate =

        Endpoint endpoint = camelContext.getEndpoint(route);
        exchange = consumerTemplate.receive(endpoint, 2000);

        // I NEED EXCEPTION HERE because must perform extra action depends
for argument


I have also own PoolStrategy bean

public class FtpConsumerPollStrategy implements PollingConsumerPollStrategy

    public boolean rollback(Consumer consumer, Endpoint endpoint, int
retryCounter, Exception e) throws Exception {

        //HERE I GET EXCEPTION but any code don't propagate exception to
main bean
// throw e; // this should work

//        Exchange exchange = endpoint.createExchange();
//        exchange.setException(e);
//       ((FtpConsumer)consumer).getProcessor().process(exchange);

        return false;

Generally when all is ok and file on server exists I receive it, but when
exception occurs then I cann't perform any  action.
How can I handle exception where I need it ?

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message