I need to have the time more than 60 seconds, as if an application is down,
reason can be anything and it may take more than even half an hour. If I hit
it every 60 seconds it will unnecessarily create traffic.

I want to do something like this:
exception(java.net.SocketException.class)
                .maximumRedeliveries(5)
                .useExponentialBackOff()
                .initialRedeliveryDelay(300000)
                .backOffMultiplier(2.0)
                .maximumRedeliveryDelay(99999999L)                 
                .intercept(new 
CustomDelegateProcessor(ErrorConstants.SOCKET_ERROR));
          

If I have not misunderstood the camel 1.4 source code, class
RedeliveryPolicy has the default setting for  maximumRedeliveryDelay to 60
seconds.

It also has a setter method for changing it. So this class has everything
and I want to use it by writing some custom code as follows:

1)Extend class org.apache.camel.model.ExceptionType in custom say class
CustomExceptionType
2)CustomExceptionType will have a method 

public ExceptionType maximumRedeliveryDelay(long maximumRedeliveryDelay) {

       
getOrCreateRedeliveryPolicy().maximumRedeliveryDelay(maximumRedeliveryDelay);

        return this;

}

3)CustomExceptionType will override following method method 
protected RedeliveryPolicyType getOrCreateRedeliveryPolicy() {

        if (redeliveryPolicy == null) {

            redeliveryPolicy = new CustomRedeliveryPolicyType();

        }

        return redeliveryPolicy;

    }


3)I also have to extend class org.apache.camel.model.RedeliveryPolicyType to
have maximumRedeliveryDelay.
I will create class CustomRedeliveryPolicyType which will extend
org.apache.camel.model.RedeliveryPolicyType and have setters and getters for
maximumRedeliveryDelay.

What do you think about this solution?

I don't know how can I tell my Routing java (DSL) to use my
CustomExceptionType rather than org.apache.camel.model.ExceptionType as
currently it uses org.apache.camel.model.ExceptionType by default.

How to do this? Please help.
-- 
View this message in context: 
http://www.nabble.com/camel-1.4-redelivery-issue-tp18960138s22882p18963077.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to