Hi

Ah it's exposed on the DLC so you can set it on the DLC. 
     deadLetterChannel().maximumRedeliveryDelay(9999999L);

And then you original code (without the maximumRedeliveryDelay)
exception(java.net.SocketException.class)
                .maximumRedeliveries(5)
                .useExponentialBackOff()
                .initialRedeliveryDelay(300000)
                .backOffMultiplier(2.0)
                .intercept(new 
CustomDelegateProcessor(ErrorConstants.SOCKET_ERROR));


And then you can have the other settings per redelivery policy you have 
configured. However then it's a global setting and not curtom per. Redelivery 
policy (probably a missing in Camel 1.4). I will add a JIRA for this.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: pratibhaG [mailto:[EMAIL PROTECTED] 
Sent: 13. august 2008 15:29
To: [email protected]
Subject: RE: camel 1.4 redelivery issue


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