You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Nazar <vi...@gmail.com> on 2018/02/15 15:43:51 UTC

Failover transport hangs up when trying to initialize second connection in the pool

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:

spring:
  activemq:
    broker-url: failover://(tcp://localhost:61616)
But when broker URL contains Failover protocol my application hangs up:

spring:
  activemq:
    broker-url: tcp://localhost:61616
When I add logging I found that for some reason transport cannot reconnect:

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}

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.

Originally issue is  here (AMQ-6888)
<https://issues.apache.org/jira/browse/AMQ-6888>  .



--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html