|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.processor.RedeliveryPolicy
public class RedeliveryPolicy
The policy used to decide how many times to redeliver and the time between the redeliveries before being sent to a Dead Letter Channel
The default values is:
Field Summary | |
---|---|
protected double |
backOffMultiplier
|
protected double |
collisionAvoidanceFactor
|
protected long |
initialRedeliveryDelay
|
protected int |
maximumRedeliveries
|
protected static Random |
randomNumberGenerator
|
protected boolean |
useCollisionAvoidance
|
protected boolean |
useExponentialBackOff
|
Constructor Summary | |
---|---|
RedeliveryPolicy()
|
Method Summary | |
---|---|
RedeliveryPolicy |
backOffMultiplier(double multiplier)
Enables exponential backoff and sets the multiplier used to increase the delay between redeliveries |
RedeliveryPolicy |
collisionAvoidancePercent(double collisionAvoidancePercent)
Enables collision avoidence and sets the percentage used |
RedeliveryPolicy |
copy()
|
double |
getBackOffMultiplier()
|
double |
getCollisionAvoidanceFactor()
|
short |
getCollisionAvoidancePercent()
|
long |
getInitialRedeliveryDelay()
|
int |
getMaximumRedeliveries()
|
protected static Random |
getRandomNumberGenerator()
|
long |
getRedeliveryDelay(long previousDelay)
|
RedeliveryPolicy |
initialRedeliveryDelay(long initialRedeliveryDelay)
Sets the initial redelivery delay in milliseconds on the first redelivery |
boolean |
isUseCollisionAvoidance()
|
boolean |
isUseExponentialBackOff()
|
RedeliveryPolicy |
maximumRedeliveries(int maximumRedeliveries)
Sets the maximum number of times a message exchange will be redelivered |
void |
setBackOffMultiplier(double backOffMultiplier)
Sets the multiplier used to increase the delay between redeliveries if setUseExponentialBackOff(boolean) is enabled |
void |
setCollisionAvoidanceFactor(double collisionAvoidanceFactor)
Sets the factor used for collision avoidence if enabled via setUseCollisionAvoidance(boolean) |
void |
setCollisionAvoidancePercent(double collisionAvoidancePercent)
Sets the percentage used for collision avoidence if enabled via setUseCollisionAvoidance(boolean) |
void |
setInitialRedeliveryDelay(long initialRedeliveryDelay)
Sets the initial redelivery delay in milliseconds on the first redelivery |
void |
setMaximumRedeliveries(int maximumRedeliveries)
Sets the maximum number of times a message exchange will be redelivered. |
void |
setUseCollisionAvoidance(boolean useCollisionAvoidance)
Enables/disables collision avoidence which adds some randomization to the backoff timings to reduce contention probability |
void |
setUseExponentialBackOff(boolean useExponentialBackOff)
Enables/disables exponential backof using the getBackOffMultiplier() to increase the time between retries |
boolean |
shouldRedeliver(int redeliveryCounter)
Returns true if the policy decides that the message exchange should be redelivered |
String |
toString()
|
RedeliveryPolicy |
useCollisionAvoidance()
Enables collision avoidence which adds some randomization to the backoff timings to reduce contention probability |
RedeliveryPolicy |
useExponentialBackOff()
Enables exponential backof using the getBackOffMultiplier() to
increase the time between retries |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static transient Random randomNumberGenerator
protected int maximumRedeliveries
protected long initialRedeliveryDelay
protected double backOffMultiplier
protected boolean useExponentialBackOff
protected double collisionAvoidanceFactor
protected boolean useCollisionAvoidance
Constructor Detail |
---|
public RedeliveryPolicy()
Method Detail |
---|
public String toString()
toString
in class Object
public RedeliveryPolicy copy()
public boolean shouldRedeliver(int redeliveryCounter)
public RedeliveryPolicy maximumRedeliveries(int maximumRedeliveries)
public RedeliveryPolicy initialRedeliveryDelay(long initialRedeliveryDelay)
public RedeliveryPolicy useCollisionAvoidance()
public RedeliveryPolicy useExponentialBackOff()
getBackOffMultiplier()
to
increase the time between retries
public RedeliveryPolicy backOffMultiplier(double multiplier)
public RedeliveryPolicy collisionAvoidancePercent(double collisionAvoidancePercent)
public double getBackOffMultiplier()
public void setBackOffMultiplier(double backOffMultiplier)
setUseExponentialBackOff(boolean)
is enabled
public short getCollisionAvoidancePercent()
public void setCollisionAvoidancePercent(double collisionAvoidancePercent)
setUseCollisionAvoidance(boolean)
public double getCollisionAvoidanceFactor()
public void setCollisionAvoidanceFactor(double collisionAvoidanceFactor)
setUseCollisionAvoidance(boolean)
public long getInitialRedeliveryDelay()
public void setInitialRedeliveryDelay(long initialRedeliveryDelay)
public int getMaximumRedeliveries()
public void setMaximumRedeliveries(int maximumRedeliveries)
public long getRedeliveryDelay(long previousDelay)
public boolean isUseCollisionAvoidance()
public void setUseCollisionAvoidance(boolean useCollisionAvoidance)
public boolean isUseExponentialBackOff()
public void setUseExponentialBackOff(boolean useExponentialBackOff)
getBackOffMultiplier()
to increase the time between retries
protected static Random getRandomNumberGenerator()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |