mirror of https://github.com/apache/activemq.git
Add a check to the iterate() so that on failover - it's not possible
to iterate for ever if the transport has actually been stopped git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@373862 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
815b6c5d87
commit
3e7ebc2368
|
@ -170,22 +170,21 @@ public class FailoverTransport implements CompositeTransport {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
log.debug("Waiting " + reconnectDelay + " ms before attempting connection. ");
|
||||
Thread.sleep(reconnectDelay);
|
||||
if(!disposed){
|
||||
try{
|
||||
log.debug("Waiting "+reconnectDelay+" ms before attempting connection. ");
|
||||
Thread.sleep(reconnectDelay);
|
||||
}catch(InterruptedException e1){
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
if(useExponentialBackOff){
|
||||
// Exponential increment of reconnect delay.
|
||||
reconnectDelay*=backOffMultiplier;
|
||||
if(reconnectDelay>maxReconnectDelay)
|
||||
reconnectDelay=maxReconnectDelay;
|
||||
}
|
||||
}
|
||||
catch (InterruptedException e1) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
|
||||
if (useExponentialBackOff) {
|
||||
// Exponential increment of reconnect delay.
|
||||
reconnectDelay *= backOffMultiplier;
|
||||
if (reconnectDelay > maxReconnectDelay)
|
||||
reconnectDelay = maxReconnectDelay;
|
||||
}
|
||||
return true;
|
||||
return !disposed;
|
||||
}
|
||||
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue