clebertsuconic commented on a change in pull request #2830: ARTEMIS-2479
Initial connection will not work with infinite retry
URL: https://github.com/apache/activemq-artemis/pull/2830#discussion_r322753498
##########
File path:
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ServerLocatorImpl.java
##########
@@ -780,23 +798,25 @@ public ClientSessionFactory createSessionFactory()
throws ActiveMQException {
factory = new ClientSessionFactoryImpl(this, tc, callTimeout,
callFailoverTimeout, clientFailureCheckPeriod, connectionTTL, retryInterval,
retryIntervalMultiplier, maxRetryInterval, reconnectAttempts, threadPool,
scheduledThreadPool, incomingInterceptors, outgoingInterceptors);
try {
addToConnecting(factory);
- factory.connect(initialConnectAttempts,
failoverOnInitialConnection);
+ // We always try to connect here with only one attempt,
+ // as we will perform the initial retry here, looking for
all possible connectors
+ factory.connect(1, false);
} finally {
removeFromConnecting(factory);
}
} catch (ActiveMQException e) {
+ if (factory.waitForRetry(retryInterval)) {
Review comment:
I put it before as the factory close wouldn't let me wait
I modified the code slightly to what I think it's best
I'm still working on a test failure on this PR, I will remove the
DO-NOT-MERGE-YET when ready.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services