mirror of https://github.com/apache/activemq.git
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@814638 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f3b1ea9cfb
commit
3720e847d1
|
@ -85,6 +85,7 @@ public class FailoverTransport implements CompositeTransport {
|
|||
private boolean randomize = true;
|
||||
private boolean initialized;
|
||||
private int maxReconnectAttempts;
|
||||
private int startupMaxReconnectAttempts;
|
||||
private int connectFailures;
|
||||
private long reconnectDelay = this.initialReconnectDelay;
|
||||
private Exception connectionFailure;
|
||||
|
@ -316,6 +317,14 @@ public class FailoverTransport implements CompositeTransport {
|
|||
public void setMaxReconnectAttempts(int maxReconnectAttempts) {
|
||||
this.maxReconnectAttempts = maxReconnectAttempts;
|
||||
}
|
||||
|
||||
public int getStartupMaxReconnectAttempts() {
|
||||
return this.startupMaxReconnectAttempts;
|
||||
}
|
||||
|
||||
public void setStartupMaxReconnectAttempts(int startupMaxReconnectAttempts) {
|
||||
this.startupMaxReconnectAttempts = startupMaxReconnectAttempts;
|
||||
}
|
||||
|
||||
public long getTimeout() {
|
||||
return timeout;
|
||||
|
@ -753,8 +762,8 @@ public class FailoverTransport implements CompositeTransport {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (maxReconnectAttempts > 0 && ++connectFailures >= maxReconnectAttempts) {
|
||||
long reconnectAttempts = firstConnection ? this.startupMaxReconnectAttempts : this.maxReconnectAttempts;
|
||||
if (reconnectAttempts > 0 && ++connectFailures >= reconnectAttempts) {
|
||||
LOG.error("Failed to connect to transport after: " + connectFailures + " attempt(s)");
|
||||
connectionFailure = failure;
|
||||
|
||||
|
|
Loading…
Reference in New Issue