You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2019/10/21 13:03:09 UTC
[activemq-artemis] branch master updated: ARTEMIS-2523 Deprecate
the parameter failoverOnInitialConnection
This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/master by this push:
new 98746a2 ARTEMIS-2523 Deprecate the parameter failoverOnInitialConnection
new c3eacfd This closes #2866
98746a2 is described below
commit 98746a20a118f0a1463badb7d688680060e0f9dd
Author: brusdev <br...@gmail.com>
AuthorDate: Mon Oct 21 07:04:21 2019 +0200
ARTEMIS-2523 Deprecate the parameter failoverOnInitialConnection
The parameter failoverOnInitialConnection wouldn't seem to be used and
makes no sense any more, because the connectors are retried in a loop.
So someone can just add the backup in the initial connection.
---
.../artemis/api/core/client/ActiveMQClient.java | 1 +
.../artemis/api/core/client/ServerLocator.java | 20 +++++++++++
.../core/client/impl/ClientSessionFactoryImpl.java | 10 ++++--
.../client/impl/ClientSessionFactoryInternal.java | 7 ++++
.../core/client/impl/ServerLocatorImpl.java | 41 +++++++---------------
.../jms/client/ActiveMQConnectionFactory.java | 6 ++--
.../config/ConnectionFactoryConfiguration.java | 2 ++
.../impl/ConnectionFactoryConfigurationImpl.java | 13 +++----
.../artemis/ra/ActiveMQResourceAdapter.java | 18 ++--------
.../artemis/ra/ConnectionFactoryProperties.java | 14 ++------
.../tests/extras/byteman/BMFailoverTest.java | 6 ++--
.../client/ServerLocatorConnectTest.java | 2 +-
.../cluster/failover/FailBackAutoTest.java | 2 +-
.../cluster/failover/FailBackManualTest.java | 2 +-
.../cluster/failover/FailoverListenerTest.java | 4 +--
.../integration/cluster/failover/FailoverTest.java | 12 ++-----
.../cluster/failover/LiveToLiveFailoverTest.java | 4 +--
.../integration/jms/client/ConnectionTest.java | 2 +-
.../ConnectionFactorySerializationTest.java | 2 +-
19 files changed, 81 insertions(+), 87 deletions(-)
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
index f4de508..5ca294d 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ActiveMQClient.java
@@ -113,6 +113,7 @@ public final class ActiveMQClient {
public static final int INITIAL_CONNECT_ATTEMPTS = 1;
+ @Deprecated
public static final boolean DEFAULT_FAILOVER_ON_INITIAL_CONNECTION = false;
public static final boolean DEFAULT_IS_HA = false;
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java
index 38aa1a7..2dbe0ba 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/api/core/client/ServerLocator.java
@@ -96,11 +96,29 @@ public interface ServerLocator extends AutoCloseable {
*
* @param transportConfiguration
* @param reconnectAttempts number of attempts of reconnection to perform
+ * @return a {@link ClientSessionFactory} instance
+ * @throws Exception if a failure happened in creating the ClientSessionFactory or the
+ * ServerLocator does not know about the passed in transportConfiguration
+ */
+ ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration,
+ int reconnectAttempts) throws Exception;
+
+ /**
+ * Creates a {@link ClientSessionFactory} to a specific server. The server must already be known
+ * about by this ServerLocator. This method allows the user to make a connection to a specific
+ * server bypassing any load balancing policy in force
+ *
+ * @deprecated This method is no longer acceptable to create a client session factory.
+ * Replaced by {@link ServerLocator#createSessionFactory(TransportConfiguration, int)}.
+ *
+ * @param transportConfiguration
+ * @param reconnectAttempts number of attempts of reconnection to perform
* @param failoverOnInitialConnection
* @return a {@link ClientSessionFactory} instance
* @throws Exception if a failure happened in creating the ClientSessionFactory or the
* ServerLocator does not know about the passed in transportConfiguration
*/
+ @Deprecated
ClientSessionFactory createSessionFactory(TransportConfiguration transportConfiguration,
int reconnectAttempts,
boolean failoverOnInitialConnection) throws Exception;
@@ -643,6 +661,7 @@ public interface ServerLocator extends AutoCloseable {
* <p>
* Default value is {@link ActiveMQClient#DEFAULT_FAILOVER_ON_INITIAL_CONNECTION}.
*/
+ @Deprecated
boolean isFailoverOnInitialConnection();
/**
@@ -651,6 +670,7 @@ public interface ServerLocator extends AutoCloseable {
* @param failover
* @return this ServerLocator
*/
+ @Deprecated
ServerLocator setFailoverOnInitialConnection(boolean failover);
/**
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index 4ca1af1..4b0394f 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -235,8 +235,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
@Override
- public void connect(final int initialConnectAttempts,
- final boolean failoverOnInitialConnection) throws ActiveMQException {
+ public void connect(final int initialConnectAttempts) throws ActiveMQException {
// Get the connection
getConnectionWithRetry(initialConnectAttempts, null);
@@ -250,6 +249,13 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
}
+ @Deprecated
+ @Override
+ public void connect(final int initialConnectAttempts,
+ final boolean failoverOnInitialConnection) throws ActiveMQException {
+ connect(initialConnectAttempts);
+ }
+
@Override
public TransportConfiguration getConnectorConfiguration() {
return currentConnectorConfig;
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java
index 408c8e7..2c57c5a 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryInternal.java
@@ -47,6 +47,13 @@ public interface ClientSessionFactoryInternal extends ClientSessionFactory {
void removeSession(ClientSessionInternal session, boolean failingOver);
+ void connect(int reconnectAttempts) throws ActiveMQException;
+
+ /**
+ * @deprecated This method is no longer acceptable to connect.
+ * Replaced by {@link ClientSessionFactoryInternal#connect(int)}.
+ */
+ @Deprecated
void connect(int reconnectAttempts, boolean failoverOnInitialConnection) throws ActiveMQException;
void setBackupConnector(TransportConfiguration live, TransportConfiguration backUp);
diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
index fd3507e..d8bccd2 100644
--- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
+++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
@@ -187,8 +187,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
private int initialConnectAttempts;
- private boolean failoverOnInitialConnection;
-
private int initialMessagePacketSize;
private final Object stateGuard = new Object();
@@ -386,8 +384,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
initialConnectAttempts = ActiveMQClient.INITIAL_CONNECT_ATTEMPTS;
- failoverOnInitialConnection = ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
-
cacheLargeMessagesClient = ActiveMQClient.DEFAULT_CACHE_LARGE_MESSAGE_CLIENT;
initialMessagePacketSize = ActiveMQClient.DEFAULT_INITIAL_MESSAGE_PACKET_SIZE;
@@ -523,7 +519,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
maxRetryInterval = locator.maxRetryInterval;
reconnectAttempts = locator.reconnectAttempts;
initialConnectAttempts = locator.initialConnectAttempts;
- failoverOnInitialConnection = locator.failoverOnInitialConnection;
initialMessagePacketSize = locator.initialMessagePacketSize;
startExecutor = locator.startExecutor;
afterConnectListener = locator.afterConnectListener;
@@ -700,6 +695,12 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
@Override
public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration) throws Exception {
+ return createSessionFactory(transportConfiguration, reconnectAttempts);
+ }
+
+ @Override
+ public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration,
+ int reconnectAttempts) throws Exception {
assertOpen();
initialize();
@@ -709,7 +710,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
addToConnecting(factory);
try {
try {
- factory.connect(reconnectAttempts, failoverOnInitialConnection);
+ factory.connect(reconnectAttempts);
} catch (ActiveMQException e1) {
//we need to make sure is closed just for garbage collection
factory.close();
@@ -722,30 +723,12 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
}
}
+ @Deprecated
@Override
public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration,
int reconnectAttempts,
boolean failoverOnInitialConnection) throws Exception {
- assertOpen();
-
- initialize();
-
- ClientSessionFactoryInternal factory = new ClientSessionFactoryImpl(this, transportConfiguration, callTimeout, callFailoverTimeout, clientFailureCheckPeriod, connectionTTL, retryInterval, retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, threadPool, scheduledThreadPool, incomingInterceptors, outgoingInterceptors);
-
- addToConnecting(factory);
- try {
- try {
- factory.connect(reconnectAttempts, failoverOnInitialConnection);
- } catch (ActiveMQException e1) {
- //we need to make sure is closed just for garbage collection
- factory.close();
- throw e1;
- }
- addFactory(factory);
- return factory;
- } finally {
- removeFromConnecting(factory);
- }
+ return createSessionFactory(transportConfiguration, reconnectAttempts);
}
private void removeFromConnecting(ClientSessionFactoryInternal factory) {
@@ -1183,15 +1166,15 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
return initialConnectAttempts;
}
+ @Deprecated
@Override
public boolean isFailoverOnInitialConnection() {
- return this.failoverOnInitialConnection;
+ return false;
}
+ @Deprecated
@Override
public ServerLocatorImpl setFailoverOnInitialConnection(final boolean failover) {
- checkWrite();
- this.failoverOnInitialConnection = failover;
return this;
}
diff --git a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
index f050c42..ef07e71 100644
--- a/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
+++ b/artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQConnectionFactory.java
@@ -740,13 +740,13 @@ public class ActiveMQConnectionFactory extends JNDIStorable implements Connectio
return serverLocator.getInitialConnectAttempts();
}
+ @Deprecated
public synchronized boolean isFailoverOnInitialConnection() {
- return serverLocator.isFailoverOnInitialConnection();
+ return false;
}
+ @Deprecated
public synchronized void setFailoverOnInitialConnection(final boolean failover) {
- checkWrite();
- serverLocator.setFailoverOnInitialConnection(failover);
}
public synchronized boolean isUseGlobalPools() {
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/ConnectionFactoryConfiguration.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/ConnectionFactoryConfiguration.java
index 97a1b64..c02631a 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/ConnectionFactoryConfiguration.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/ConnectionFactoryConfiguration.java
@@ -162,8 +162,10 @@ public interface ConnectionFactoryConfiguration extends EncodingSupport {
ConnectionFactoryConfiguration setReconnectAttempts(int reconnectAttempts);
+ @Deprecated
boolean isFailoverOnInitialConnection();
+ @Deprecated
ConnectionFactoryConfiguration setFailoverOnInitialConnection(boolean failover);
String getGroupID();
diff --git a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
index 259b2c0..e082f9f 100644
--- a/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
+++ b/artemis-jms-server/src/main/java/org/apache/activemq/artemis/jms/server/config/impl/ConnectionFactoryConfigurationImpl.java
@@ -111,8 +111,6 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
private int reconnectAttempts = ActiveMQClient.DEFAULT_RECONNECT_ATTEMPTS;
- private boolean failoverOnInitialConnection = ActiveMQClient.DEFAULT_FAILOVER_ON_INITIAL_CONNECTION;
-
private String groupID = null;
private String protocolManagerFactoryStr;
@@ -518,14 +516,15 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
return this;
}
+ @Deprecated
@Override
public boolean isFailoverOnInitialConnection() {
- return failoverOnInitialConnection;
+ return false;
}
+ @Deprecated
@Override
public ConnectionFactoryConfiguration setFailoverOnInitialConnection(final boolean failover) {
- failoverOnInitialConnection = failover;
return this;
}
@@ -629,7 +628,8 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
reconnectAttempts = buffer.readInt();
- failoverOnInitialConnection = buffer.readBoolean();
+ buffer.readBoolean();
+ // failoverOnInitialConnection
compressLargeMessage = buffer.readBoolean();
@@ -724,7 +724,8 @@ public class ConnectionFactoryConfigurationImpl implements ConnectionFactoryConf
buffer.writeInt(reconnectAttempts);
- buffer.writeBoolean(failoverOnInitialConnection);
+ buffer.writeBoolean(false);
+ // failoverOnInitialConnection
buffer.writeBoolean(compressLargeMessage);
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java
index d76bd9a..ba6127b 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ActiveMQResourceAdapter.java
@@ -614,12 +614,8 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable {
*
* @param failoverOnInitialConnection The value
*/
+ @Deprecated
public void setFailoverOnInitialConnection(final Boolean failoverOnInitialConnection) {
- if (logger.isTraceEnabled()) {
- logger.trace("setFailoverOnInitialConnection(" + failoverOnInitialConnection + ")");
- }
-
- raProperties.setFailoverOnInitialConnection(failoverOnInitialConnection);
}
/**
@@ -627,12 +623,9 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable {
*
* @return The value
*/
+ @Deprecated
public Boolean isFailoverOnInitialConnection() {
- if (logger.isTraceEnabled()) {
- logger.trace("isFailoverOnInitialConnection()");
- }
-
- return raProperties.isFailoverOnInitialConnection();
+ return false;
}
/**
@@ -1955,11 +1948,6 @@ public class ActiveMQResourceAdapter implements ResourceAdapter, Serializable {
cf.setCompressLargeMessage(val);
}
- val = overrideProperties.isFailoverOnInitialConnection() != null ? overrideProperties.isFailoverOnInitialConnection() : raProperties.isFailoverOnInitialConnection();
- if (val != null) {
- cf.setFailoverOnInitialConnection(val);
- }
-
val = overrideProperties.isCacheDestinations() != null ? overrideProperties.isCacheDestinations() : raProperties.isCacheDestinations();
if (val != null) {
cf.setCacheDestinations(val);
diff --git a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java
index 5cdb000..9cb783a 100644
--- a/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java
+++ b/artemis-ra/src/main/java/org/apache/activemq/artemis/ra/ConnectionFactoryProperties.java
@@ -79,8 +79,6 @@ public class ConnectionFactoryProperties implements ConnectionFactoryOptions {
private Integer confirmationWindowSize;
- private Boolean failoverOnInitialConnection;
-
private Integer producerMaxRate;
private Integer minLargeMessageSize;
@@ -415,13 +413,13 @@ public class ConnectionFactoryProperties implements ConnectionFactoryOptions {
this.confirmationWindowSize = confirmationWindowSize;
}
+ @Deprecated
public Boolean isFailoverOnInitialConnection() {
- return failoverOnInitialConnection;
+ return false;
}
+ @Deprecated
public void setFailoverOnInitialConnection(Boolean failoverOnInitialConnection) {
- hasBeenUpdated = true;
- this.failoverOnInitialConnection = failoverOnInitialConnection;
}
public Integer getProducerMaxRate() {
@@ -799,11 +797,6 @@ public class ConnectionFactoryProperties implements ConnectionFactoryOptions {
return false;
} else if (!this.compressLargeMessage.equals(other.compressLargeMessage))
return false;
- if (this.failoverOnInitialConnection == null) {
- if (other.failoverOnInitialConnection != null)
- return false;
- } else if (!this.failoverOnInitialConnection.equals(other.failoverOnInitialConnection))
- return false;
if (this.ha == null) {
if (other.ha != null)
return false;
@@ -1039,7 +1032,6 @@ public class ConnectionFactoryProperties implements ConnectionFactoryOptions {
result = prime * result + ((protocolManagerFactoryStr == null) ? 0 : protocolManagerFactoryStr.hashCode());
result = prime * result + ((consumerMaxRate == null) ? 0 : consumerMaxRate.hashCode());
result = prime * result + ((confirmationWindowSize == null) ? 0 : confirmationWindowSize.hashCode());
- result = prime * result + ((failoverOnInitialConnection == null) ? 0 : failoverOnInitialConnection.hashCode());
result = prime * result + ((producerMaxRate == null) ? 0 : producerMaxRate.hashCode());
result = prime * result + ((minLargeMessageSize == null) ? 0 : minLargeMessageSize.hashCode());
result = prime * result + ((blockOnAcknowledge == null) ? 0 : blockOnAcknowledge.hashCode());
diff --git a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java
index 9ccd1f8..6e6509f 100644
--- a/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java
+++ b/tests/extra-tests/src/test/java/org/apache/activemq/artemis/tests/extras/byteman/BMFailoverTest.java
@@ -166,7 +166,7 @@ public class BMFailoverTest extends FailoverTestBase {
action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)")})
public void testFailoverOnCommit2() throws Exception {
serverToStop = liveServer;
- locator = getServerLocator().setFailoverOnInitialConnection(true);
+ locator = getServerLocator();
SimpleString inQueue = new SimpleString("inQueue");
SimpleString outQueue = new SimpleString("outQueue");
createSessionFactory();
@@ -253,7 +253,7 @@ public class BMFailoverTest extends FailoverTestBase {
action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)")})
public void testFailoverOnCommit() throws Exception {
serverToStop = liveServer;
- locator = getServerLocator().setFailoverOnInitialConnection(true);
+ locator = getServerLocator();
createSessionFactory();
ClientSession session = createSessionAndQueue();
@@ -282,7 +282,7 @@ public class BMFailoverTest extends FailoverTestBase {
action = "org.apache.activemq.artemis.tests.extras.byteman.BMFailoverTest.serverToStop.getServer().stop(true)")})
public void testFailoverOnReceiveCommit() throws Exception {
serverToStop = liveServer;
- locator = getServerLocator().setFailoverOnInitialConnection(true);
+ locator = getServerLocator();
createSessionFactory();
ClientSession session = createSessionAndQueue();
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
index 3621897..de3b66e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/client/ServerLocatorConnectTest.java
@@ -63,7 +63,7 @@ public class ServerLocatorConnectTest extends ActiveMQTestBase {
"transactionBatchSize=1048576&callTimeout=30000&preAcknowledge=false&" +
"connectionLoadBalancingPolicyClassName=org.apache.activemq.artemis.api.core.client.loadbalance." +
"RoundRobinConnectionLoadBalancingPolicy&dupsOKBatchSize=1048576&initialMessagePacketSize=1500&" +
- "consumerMaxRate=-1&retryInterval=2000&failoverOnInitialConnection=false&producerWindowSize=65536&" +
+ "consumerMaxRate=-1&retryInterval=2000&producerWindowSize=65536&" +
"port=61616&host=localhost#");
// try it a few times to make sure it fails if it's broken
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java
index 666a677..6f66d86 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackAutoTest.java
@@ -231,7 +231,7 @@ public class FailBackAutoTest extends FailoverTestBase {
}
private void createSessionFactory() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true) // unnecessary?
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true) // unnecessary?
.setReconnectAttempts(15);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
}
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java
index 9537433..b74af0d 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailBackManualTest.java
@@ -50,7 +50,7 @@ public class FailBackManualTest extends FailoverTestBase {
@Test
public void testNoAutoFailback() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(15);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(15);
ClientSessionFactoryInternal sf = createSessionFactoryAndWaitForTopology(locator, 2);
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java
index 4bf6040..0eb8e2e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverListenerTest.java
@@ -144,7 +144,7 @@ public class FailoverListenerTest extends FailoverTestBase {
*/
@Test
public void testFailoverFailed() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true) // unnecessary?
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true) // unnecessary?
.setReconnectAttempts(1);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
@@ -170,7 +170,7 @@ public class FailoverListenerTest extends FailoverTestBase {
}
private void createSessionFactory(int members) throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true) // unnecessary?
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true) // unnecessary?
.setReconnectAttempts(15);
sf = createSessionFactoryAndWaitForTopology(locator, members);
}
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
index 5042afa..a6af13b 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/FailoverTest.java
@@ -780,7 +780,6 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testFailBackLiveRestartsBackupIsGone() throws Exception {
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
ClientSession session = createSessionAndQueue();
@@ -833,7 +832,6 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testWithoutUsingTheBackup() throws Exception {
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
ClientSession session = createSessionAndQueue();
@@ -884,7 +882,6 @@ public class FailoverTest extends FailoverTestBase {
* @throws Exception
*/
private void simpleFailover(boolean isReplicated, boolean doFailBack) throws Exception {
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
ClientSession session = createSessionAndQueue();
@@ -1029,7 +1026,7 @@ public class FailoverTest extends FailoverTestBase {
// https://jira.jboss.org/jira/browse/HORNETQ-285
@Test(timeout = 120000)
public void testFailoverOnInitialConnection() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
@@ -1653,7 +1650,7 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testCreateNewFactoryAfterFailover() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
ClientSession session = sendAndConsume(sf, true);
@@ -2195,7 +2192,6 @@ public class FailoverTest extends FailoverTestBase {
if (!(backupServer.getServer().getHAPolicy() instanceof SharedStoreSlavePolicy)) {
return;
}
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
ClientSession session = sendAndConsume(sf, true);
@@ -2225,7 +2221,6 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testLiveAndBackupLiveComesBack() throws Exception {
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
final CountDownLatch latch = new CountDownLatch(1);
@@ -2257,7 +2252,6 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testLiveAndBackupLiveComesBackNewFactory() throws Exception {
- locator.setFailoverOnInitialConnection(true);
createSessionFactory();
final CountDownLatch latch = new CountDownLatch(1);
@@ -2306,7 +2300,7 @@ public class FailoverTest extends FailoverTestBase {
@Test(timeout = 120000)
public void testLiveAndBackupBackupComesBackNewFactory() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
index 101a85e..f73785e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/cluster/failover/LiveToLiveFailoverTest.java
@@ -218,7 +218,7 @@ public class LiveToLiveFailoverTest extends FailoverTest {
@Override
@Test
public void testFailoverOnInitialConnection() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true).setReconnectAttempts(300).setRetryInterval(100);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setReconnectAttempts(300).setRetryInterval(100);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
@@ -245,7 +245,7 @@ public class LiveToLiveFailoverTest extends FailoverTest {
@Override
@Test
public void testCreateNewFactoryAfterFailover() throws Exception {
- locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true).setFailoverOnInitialConnection(true);
+ locator.setBlockOnNonDurableSend(true).setBlockOnDurableSend(true);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
ClientSession session = sendAndConsume(sf, true);
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
index f53de93..259162e 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/client/ConnectionTest.java
@@ -61,7 +61,7 @@ public class ConnectionTest extends JMSTestBase {
"transactionBatchSize=1048576&callTimeout=30000&preAcknowledge=false&" +
"connectionLoadBalancingPolicyClassName=org.apache.activemq.artemis.api.core.client.loadbalance." +
"RoundRobinConnectionLoadBalancingPolicy&dupsOKBatchSize=1048576&initialMessagePacketSize=1500&" +
- "consumerMaxRate=-1&retryInterval=2000&failoverOnInitialConnection=false&producerWindowSize=65536&" +
+ "consumerMaxRate=-1&retryInterval=2000&producerWindowSize=65536&" +
"port=61616&host=localhost#");
testThroughNewConnectionFactory(connectionFactory);
diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java
index 1ccab41..f73e934 100644
--- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java
+++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/jms/connection/ConnectionFactorySerializationTest.java
@@ -262,7 +262,7 @@ public class ConnectionFactorySerializationTest extends JMSTestBase {
ArrayList<String> connectorNames = new ArrayList<>();
connectorNames.add(main.getName());
connectorNames.add(main2.getName());
- ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl().setName("MyConnectionFactory").setHA(b).setConnectorNames(connectorNames).setClientID("clientID").setClientFailureCheckPeriod(-1).setConnectionTTL(-2).setFactoryType(JMSFactoryType.CF).setCallTimeout(-3).setCallFailoverTimeout(-4).setCacheLargeMessagesClient(b).setMinLargeMessageSize(-5).setConsumerWindowSize(-6).setConsumerMaxRate(-7).setConfirmationWindowSize(-8).setProducerWindowSize(-9).setP [...]
+ ConnectionFactoryConfiguration configuration = new ConnectionFactoryConfigurationImpl().setName("MyConnectionFactory").setHA(b).setConnectorNames(connectorNames).setClientID("clientID").setClientFailureCheckPeriod(-1).setConnectionTTL(-2).setFactoryType(JMSFactoryType.CF).setCallTimeout(-3).setCallFailoverTimeout(-4).setCacheLargeMessagesClient(b).setMinLargeMessageSize(-5).setConsumerWindowSize(-6).setConsumerMaxRate(-7).setConfirmationWindowSize(-8).setProducerWindowSize(-9).setP [...]
.setInitialMessagePacketSize(1499);
jmsServer.createConnectionFactory(false, configuration, "/MyConnectionFactory");