This closes #2866
This commit is contained in:
commit
c3eacfd4d1
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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,32 +695,12 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
|||
|
||||
@Override
|
||||
public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration) 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);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration,
|
||||
int reconnectAttempts,
|
||||
boolean failoverOnInitialConnection) throws Exception {
|
||||
int reconnectAttempts) throws Exception {
|
||||
assertOpen();
|
||||
|
||||
initialize();
|
||||
|
@ -735,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();
|
||||
|
@ -748,6 +723,14 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
|||
}
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@Override
|
||||
public ClientSessionFactory createSessionFactory(final TransportConfiguration transportConfiguration,
|
||||
int reconnectAttempts,
|
||||
boolean failoverOnInitialConnection) throws Exception {
|
||||
return createSessionFactory(transportConfiguration, reconnectAttempts);
|
||||
}
|
||||
|
||||
private void removeFromConnecting(ClientSessionFactoryInternal factory) {
|
||||
synchronized (connectingFactories) {
|
||||
connectingFactories.remove(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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -162,8 +162,10 @@ public interface ConnectionFactoryConfiguration extends EncodingSupport {
|
|||
|
||||
ConnectionFactoryConfiguration setReconnectAttempts(int reconnectAttempts);
|
||||
|
||||
@Deprecated
|
||||
boolean isFailoverOnInitialConnection();
|
||||
|
||||
@Deprecated
|
||||
ConnectionFactoryConfiguration setFailoverOnInitialConnection(boolean failover);
|
||||
|
||||
String getGroupID();
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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).setProducerMaxRate(-10).setBlockOnAcknowledge(b).setBlockOnDurableSend(b).setBlockOnNonDurableSend(b).setAutoGroup(b).setPreAcknowledge(b).setLoadBalancingPolicyClassName("foobar").setTransactionBatchSize(-11).setDupsOKBatchSize(-12).setUseGlobalPools(b).setScheduledThreadPoolMaxSize(-13).setThreadPoolMaxSize(-14).setRetryInterval(-15).setRetryIntervalMultiplier(-16).setMaxRetryInterval(-17).setReconnectAttempts(-18).setFailoverOnInitialConnection(b).setGroupID("groupID")
|
||||
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).setProducerMaxRate(-10).setBlockOnAcknowledge(b).setBlockOnDurableSend(b).setBlockOnNonDurableSend(b).setAutoGroup(b).setPreAcknowledge(b).setLoadBalancingPolicyClassName("foobar").setTransactionBatchSize(-11).setDupsOKBatchSize(-12).setUseGlobalPools(b).setScheduledThreadPoolMaxSize(-13).setThreadPoolMaxSize(-14).setRetryInterval(-15).setRetryIntervalMultiplier(-16).setMaxRetryInterval(-17).setReconnectAttempts(-18).setGroupID("groupID")
|
||||
.setInitialMessagePacketSize(1499);
|
||||
|
||||
jmsServer.createConnectionFactory(false, configuration, "/MyConnectionFactory");
|
||||
|
|
Loading…
Reference in New Issue