i have following configuration:
exception(java.net.ConnectException.class)
.maximumRedeliveries(2).useExponentialBackOff().initialRedeliveryDelay(30000).backOffMultiplier(2.0)
.to("jbi:service:http://servicemix.in2m.com/samples/http/bean1Service?mep=in-out";)
.to("jbi:service:service:http://servicemix.in2m.com/samples/http/errorHandler";);

from("jbi:service:http://servicemix.in2m.com/samples/http/jmsConsumer1";)
        .intercept(new DelegateProcessor() {
                      public void process(Exchange exchange) {
                                  proceed(exchange);
                                 System.out.println("******************
exchange"+exchange);
                                //logic to send message to Error handler        
                       }
        };  })
.to("jbi:service:http://servicemix.in2m.com/samples/http/MyProviderService?mep=in-out";);

Here
System.out.println("****************** exchange"+exchange); line prints
following:
in first attempt:
****************** exchangeExchange[JbiMessage:
[EMAIL PROTECTED]:
{}}]
 and in second attempt:
****************** exchangeExchange[JbiMessage:
[EMAIL PROTECTED]:
{org.apache.camel.Redelivered=true, org.apache.camel.RedeliveryCounter=1}}]


In my logic to send message to error handler i have to create a custom error
message and send message to error handler only in case of it is tried for
maximum redeliveries that is 2 in this case, saying RedeliveryCounter=1. 

The problem i am facing is I am not able to get the property
org.apache.camel.RedeliveryCounter=1 from exchange object. how can i get it.
as it prints in the exchange there will be some way. please help me to get
it.

-Pratibha
-- 
View this message in context: 
http://www.nabble.com/how-to-get-the-redelivery-count-tp18315153p18315153.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to