wy96f 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_r322544278
 
 

 ##########
 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:
   Can we not wait and just throw exception if exception type is NOT_CONNECTED 
or attempts exceed?

----------------------------------------------------------------
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

Reply via email to