git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@814639 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Davies 2009-09-14 13:43:54 +00:00
parent 3720e847d1
commit 31ecfae934
1 changed files with 9 additions and 1 deletions

View File

@ -762,7 +762,15 @@ public class FailoverTransport implements CompositeTransport {
}
}
}
long reconnectAttempts = firstConnection ? this.startupMaxReconnectAttempts : this.maxReconnectAttempts;
int reconnectAttempts = 0;
if (firstConnection) {
if (this.startupMaxReconnectAttempts != 0) {
reconnectAttempts = this.startupMaxReconnectAttempts;
}
}
if (reconnectAttempts==0) {
reconnectAttempts = this.maxReconnectAttempts;
}
if (reconnectAttempts > 0 && ++connectFailures >= reconnectAttempts) {
LOG.error("Failed to connect to transport after: " + connectFailures + " attempt(s)");
connectionFailure = failure;