thanks for clarifying this.

However when I try to use the dead letter channel redelivery method I got
the 

"Aggregator must be the only output added to the route" logged! And the
configured routes do not start at all.

Aggregator must be the only output added to the route:
Route[[From[jms:topic:example]] -> [Exception[[class
com.lyfam.TestException] -> [To[mock:error]]]]]

Basically I like to redeliver the exchange if the SNIPPET 1 code throws
exception.

Here is the layout of my route:

public void configure() throws Exception {
errorHandler(deadLetterChannel("mock:error").maximumRedeliveries(2));

onException(TestException.class)
                    .maximumRedeliveries(1)
                    .to("mock:error");


from("imap:localhost?username=test&password=test")
    .process(new MyProcessor())
    .to("jms:topic:example");

from("jms:topic:memo")
    .aggregator(
                        new PredicateAggregationCollection(
                                header("testId"),
                                new AggregationStrategy()
                                {
                                    @Override
                                    public Exchange aggregate(Exchange
oldExchange, Exchange newExchange)
                                    {
                                        ......
                                        return newExchange;
                                    }
                                },
                               
header(Exchange.AGGREGATED_COUNT).isEqualTo(2)))
                .batchTimeout(500L)
                .process(new Processor(){

                    // SNIPPET 1
                    @Override
                    public void process(Exchange exh) throws Exception
                    {
                        ......
                    }
                    // end SNIPPET 1
                });
}

Thanks for helping


dougly wrote:
> 
> Hi,
> I have the following route:
> 
> from("jms:topic:example").process(new MyProcessor());
> 
> If during the exchange processing exceptions are thrown, I would like to
> be able to retry that exchange again.
> 
> I am thinking about using the Transactional client described in EIP but
> also I find out that Dead Letter Channel has the redelivery mechanism to
> achieve the same thing.
> 
> So experts, in this case should I just use the Dead Letter channel
> redelivery to shift the exchange back to the JMS topic for another try?
> 
> Thanks
> 
> Doug
> 

-- 
View this message in context: 
http://www.nabble.com/Redelivery-Strategy-tp20861316s22882p20862711.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to