From 1dc9d4f45589a1e8d2565e23fb8cd0321241f6e9 Mon Sep 17 00:00:00 2001 From: franz1981 Date: Fri, 24 Sep 2021 09:00:43 +0200 Subject: [PATCH] ARTEMIS-3496 Replica connection to its live should fail fast --- .../artemis/core/server/impl/ReplicationBackupActivation.java | 2 +- .../artemis/core/server/impl/SharedNothingBackupActivation.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java index 10212e0877..35f5afeb89 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ReplicationBackupActivation.java @@ -566,7 +566,7 @@ public final class ReplicationBackupActivation extends Activation implements Dis final ReplicationObserver liveObserver) { ReplicationEndpoint replicationEndpoint = null; try { - liveControl.getSessionFactory().setReconnectAttempts(1); + liveControl.getSessionFactory().setReconnectAttempts(0); liveObserver.listenConnectionFailuresOf(liveControl.getSessionFactory()); liveControl.authorize(); replicationEndpoint = new ReplicationEndpoint(activeMQServer, policy.isTryFailback(), liveObserver); diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java index 13421c8e8c..85cbed6e93 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedNothingBackupActivation.java @@ -498,7 +498,7 @@ public final class SharedNothingBackupActivation extends Activation implements R public void run() { try { //we should only try once, if its not there we should move on. - clusterControl.getSessionFactory().setReconnectAttempts(1); + clusterControl.getSessionFactory().setReconnectAttempts(0); backupQuorum.setSessionFactory(clusterControl.getSessionFactory()); //get the connection and request replication to live clusterControl.authorize();