[ 
https://issues.apache.org/jira/browse/ARTEMIS-2479?focusedWorklogId=309514&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-309514
 ]

ASF GitHub Bot logged work on ARTEMIS-2479:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 10/Sep/19 04:06
            Start Date: 10/Sep/19 04:06
    Worklog Time Spent: 10m 
      Work Description: wy96f commented on 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:
us...@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 309514)
    Time Spent: 20m  (was: 10m)

> ActiveMQConnectionFactory may not be able to connect with 
> initialConnectAttempt=-1
> ----------------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2479
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2479
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.10.0
>            Reporter: clebert suconic
>            Assignee: clebert suconic
>            Priority: Major
>             Fix For: 2.11.0
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> you get a connectionFactory with this:
> ConnectionFactory connectionFactory = new 
> ActiveMQConnectionFactory("(tcp://localhost:61616,tcp://localhost:61617,tcp://localhost:61618)?ha=true&retryInterval=2000&retryIntervalMultiplier=1.0&reconnectAttempts=-1&initialConnectAttempts=-1&useTopologyForLoadBalancing=true");
> And say only one of these servers are available, the connection will never 
> succeed.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to