public class ReconnectionPolicy extends Object
JmsConnector
deals with
reconnection of the local and foreign connections.Modifier and Type | Field and Description |
---|---|
static int |
INFINITE |
Constructor and Description |
---|
ReconnectionPolicy() |
Modifier and Type | Method and Description |
---|---|
double |
getBackOffMultiplier()
Gets the multiplier used to grow the delay between connection attempts from the initial
time to the max set time.
|
long |
getInitialReconnectDelay()
Gets the initial delay value used before a reconnection attempt is made.
|
long |
getMaximumReconnectDelay()
Gets the maximum delay that is inserted between each attempt to connect
before another attempt is made.
|
int |
getMaxInitialConnectAttempts()
Gets the maximum number of times that the
JmsConnector will try
to connect on startup to before it marks itself as failed and does not
try any further connections. |
int |
getMaxReconnectAttempts()
Gets the number of time that
JmsConnector will attempt to connect
or reconnect before giving up. |
int |
getMaxSendRetries()
Gets the maximum number of a times a Message send should be retried before
a JMSExeception is thrown indicating that the operation failed.
|
long |
getNextDelay(int attempt)
Returns the next computed delay value that the connection controller should use to
wait before attempting another connection for the
JmsConnector . |
long |
getSendRetryDelay()
Get the amount of time the DestionationBridge will wait between attempts
to forward a message.
|
boolean |
isUseExponentialBackOff()
Gets whether the policy uses the set back-off multiplier to grow the time between
connection attempts.
|
void |
setBackOffMultiplier(double backOffMultiplier)
Gets the multiplier used to grow the delay between connection attempts from the initial
time to the max set time.
|
void |
setInitialReconnectDelay(long initialReconnectDelay)
Gets the initial delay value used before a reconnection attempt is made.
|
void |
setMaximumReconnectDelay(long maximumReconnectDelay)
Sets the maximum delay that is inserted between each attempt to connect
before another attempt is made.
|
void |
setMaxInitialConnectAttempts(int maxAttempts)
Sets the maximum number of times that the
JmsConnector will try
to connect on startup to before it marks itself as failed and does not
try any further connections. |
void |
setMaxReconnectAttempts(int maxReconnectAttempts)
Sets the number of time that
JmsConnector will attempt to connect
or reconnect before giving up. |
void |
setMaxSendRetries(int maxSendRetries)
Sets the maximum number of a times a Message send should be retried before
a JMSExeception is thrown indicating that the operation failed.
|
void |
setSendRetyDelay(long sendRetryDelay)
Set the amount of time the DestionationBridge will wait between attempts
to forward a message.
|
void |
setUseExponentialBackOff(boolean useExponentialBackOff)
Sets whether the policy uses the set back-off multiplier to grow the time between
connection attempts.
|
public static final int INFINITE
public ReconnectionPolicy()
public int getMaxSendRetries()
public void setMaxSendRetries(int maxSendRetries)
maxSendRetries
- number of send retries that will be performed.public long getSendRetryDelay()
public void setSendRetyDelay(long sendRetryDelay)
sendRetryDelay
- Time in milliseconds to wait before attempting another send.public int getMaxReconnectAttempts()
JmsConnector
will attempt to connect
or reconnect before giving up. By default the policy sets this value to
a negative value meaning try forever.public void setMaxReconnectAttempts(int maxReconnectAttempts)
JmsConnector
will attempt to connect
or reconnect before giving up. By default the policy sets this value to
a negative value meaning try forever, set to a positive value to retry a
fixed number of times, or zero to never try and reconnect.maxReconnectAttempts
- public int getMaxInitialConnectAttempts()
JmsConnector
will try
to connect on startup to before it marks itself as failed and does not
try any further connections.public void setMaxInitialConnectAttempts(int maxAttempts)
JmsConnector
will try
to connect on startup to before it marks itself as failed and does not
try any further connections.maxAttempts
- The max number of times a connection attempt is made before failing.public long getMaximumReconnectDelay()
public void setMaximumReconnectDelay(long maximumReconnectDelay)
maximumReconnectDelay
- The maximum delay between connection attempts in milliseconds.public long getInitialReconnectDelay()
public void setInitialReconnectDelay(long initialReconnectDelay)
initialReconnectDelay
- Time in milliseconds to wait before the first reconnection attempt.public boolean isUseExponentialBackOff()
public void setUseExponentialBackOff(boolean useExponentialBackOff)
useExponentialBackOff
- public double getBackOffMultiplier()
public void setBackOffMultiplier(double backOffMultiplier)
backOffMultiplier
- The multiplier value used to grow the reconnection delay.public long getNextDelay(int attempt)
JmsConnector
.attempt
- The current connection attempt.Copyright © 2005–2018 The Apache Software Foundation. All rights reserved.