Nazar Vishka created AMQ-6888:
---------------------------------

             Summary: Failover transport hangs up when trying to initialize 
second connection in the pool
                 Key: AMQ-6888
                 URL: https://issues.apache.org/jira/browse/AMQ-6888
             Project: ActiveMQ
          Issue Type: Bug
          Components: JMS client
    Affects Versions: 5.15.2, 5.14.5
            Reporter: Nazar Vishka


I have quite simple Spring Boot application. Inside it I have:
 * ActiveMQ client
 * Bitronix Transaction manager
 * My own LogBack JMS Appender that is sending logs to the AMQ queue.

Code can be found [here|https://github.com/leofromgroza/amq-failover-issue].

Everything is working perfectly when I start my application with such AMQ 
Broker URL:
{code:java}
spring:
  activemq:
    broker-url: failover://(tcp://localhost:61616){code}
But when broker URL contains Failover protocol my application hangs up:
{code:java}
spring:
  activemq:
    broker-url: tcp://localhost:61616{code}
When I add logging I found that for some reason transport cannot reconnect:
{code:java}
10:20:55.352 [main] DEBUG o.a.a.thread.TaskRunnerFactory - Initialized 
TaskRunnerFactory[ActiveMQ Task] using ExecutorService: 
java.util.concurrent.ThreadPoolExecutor@6492fab5[Running, pool size = 0, active 
threads = 0, queued tasks = 0, completed tasks = 0]
10:20:55.353 [main] DEBUG o.a.a.t.f.FailoverTransport - Reconnect was triggered 
but transport is not started yet. Wait for start to connect the transport.
10:20:55.355 [main] TRACE o.a.activemq.util.IdGenerator - Using port 0
10:20:55.460 [main] DEBUG o.a.a.t.f.FailoverTransport - Started unconnected
10:20:55.460 [main] DEBUG o.a.a.t.f.FailoverTransport - Waking up reconnect task
10:20:55.460 [main] TRACE o.a.a.thread.TaskRunnerFactory - Created 
thread[ActiveMQ Task-1]: Thread[ActiveMQ Task-1,5,main]
10:20:55.461 [ActiveMQ Task-1] TRACE o.a.a.thread.PooledTaskRunner - Running 
task iteration 0 - 
org.apache.activemq.transport.failover.FailoverTransport$2@5ec2b1ee
10:20:55.462 [main] TRACE o.a.a.t.f.FailoverTransport - Waiting for transport 
to reconnect..: ConnectionInfo {commandId = 1, responseRequired = true, 
connectionId = ID:MyPC-52107-1516609255356-1:1, clientId = 
ID:MyPC-52107-1516609255356-0:1, clientIp = null, userName = null, password = 
*****, brokerPath = null, brokerMasterConnector = false, manageable = true, 
clientMaster = true, faultTolerant = true, failoverReconnect = false}
10:20:55.564 [main] TRACE o.a.a.t.f.FailoverTransport - Waiting for transport 
to reconnect..: ConnectionInfo {commandId = 1, responseRequired = true, 
connectionId = ID:MyPC-52107-1516609255356-1:1, clientId = 
ID:MyPC-52107-1516609255356-0:1, clientIp = null, userName = null, password = 
*****, brokerPath = null, brokerMasterConnector = false, manageable = true, 
clientMaster = true, faultTolerant = true, failoverReconnect = false}
10:20:55.665 [main] TRACE o.a.a.t.f.FailoverTransport - Waiting for transport 
to reconnect..: ConnectionInfo {commandId = 1, responseRequired = true, 
connectionId = ID:MyPC-52107-1516609255356-1:1, clientId = 
ID:MyPC-52107-1516609255356-0:1, clientIp = null, userName = null, password = 
*****, brokerPath = null, brokerMasterConnector = false, manageable = true, 
clientMaster = true, faultTolerant = true, failoverReconnect = false}
10:20:55.765 [main] TRACE o.a.a.t.f.FailoverTransport - Waiting for transport 
to reconnect..: ConnectionInfo {commandId = 1, responseRequired = true, 
connectionId = ID:MyPC-52107-1516609255356-1:1, clientId = 
ID:MyPC-52107-1516609255356-0:1, clientIp = null, userName = null, password = 
*****, brokerPath = null, brokerMasterConnector = false, manageable = true, 
clientMaster = true, faultTolerant = true, failoverReconnect = false}
{code}
Also I found that issue happened with the second XA connection in the pool. 
First one was connected properly without any problems. I have tried different 
two versions of AMQ client and server (5.14.5, 5.15.2) and the behavior is the 
same.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to