ActiveMQ 5.10 closes connection intermittently when configured in Failover Transport

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ActiveMQ 5.10 closes connection intermittently when configured in Failover Transport

amol.p.dongare
This post was updated on .
I have Three ActiveMQ 5.10 brokers configured externally and TomEE (1.7.2
cluster (4-5 serves) connects to them via failover transport.

Following is my configuration

A. TomEE.xml  

<Resource>
          serverUrl failover://(http://192.168.31.1:61616,http
          ://192.168.31.1:51515,http://cos1plp:41414)?randomize=false
          brokerXmlConfig =
</Resource>

B. Broker configured over http protocol -
Broker 1

<transportConnectors> 
       
           <transportConnector name="vm"  
uri="vm://localhost?waitForStart=20000&amp;async=true"/>
                   <transportConnector name="http"
uri="http://0.0.0.0:61616?daemon=false&amp;transport.useInactivityMonitor=false&amp;transport.soTimeout=0&amp;transport.soWriteTimeout=0&amp;jms.redeliveryPolicy.maximumRedeliveries=-1"/>

            <transportConnector name="tcp"
uri="http://0.0.0.0:61617?daemon=false"/>         
         
 </transportConnectors>

Broker 2

<transportConnectors>   
       
           <transportConnector name="vm"  
uri="vm://localhost?waitForStart=20000&amp;async=true"/>
                   <transportConnector name="http"
uri="http://0.0.0.0:51515?daemon=false&amp;transport.useInactivityMonitor=false&amp;transport.soTimeout=0&amp;transport.soWriteTimeout=0&amp;jms.redeliveryPolicy.maximumRedeliveries=-1"/>

            <transportConnector name="tcp"
uri="http://0.0.0.0:51517?daemon=false"/>         
         
 </transportConnectors>

Broker 3

<transportConnectors>   
       
           <transportConnector name="vm"  
uri="vm://localhost?waitForStart=20000&amp;async=true"/>
                   <transportConnector name="http"
uri="http://0.0.0.0:41414?daemon=false&amp;transport.useInactivityMonitor=false&amp;transport.soTimeout=0&amp;transport.soWriteTimeout=0&amp;jms.redeliveryPolicy.maximumRedeliveries=-1"/>

            <transportConnector name="tcp"
uri="http://0.0.0.0:41417?daemon=false"/>         
         
 </transportConnectors>

Here everyone on the same machine TomEE, ActiveMQ brokers, however still I
saw disconnection between TomEE and broker and it always tries to reconnect.
TomEE reconnects successfully but transaction gets failed, here is the log
from TomEE-

Sep 25, 2017 3:55:26 PM
org.apache.activemq.transport.http.HttpClientTransport$1 handleResponse
INFO: Broker Servlet supports GZip compression.
Sep 25, 2017 3:55:26 PM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to http://192.168.31.1:61616
Sep 25, 2017 3:55:26 PM
org.apache.activemq.transport.http.HttpClientTransport$1 handleResponse
INFO: Broker Servlet supports GZip compression.
Sep 25, 2017 3:55:26 PM*
org.apache.activemq.transport.failover.FailoverTransport doReconnect
*
INFO: Successfully connected to *http*://192.168.31.1:61616
Sep 25, 2017 3:55:26 PM
org.apache.activemq.transport.http.HttpClientTransport$1 handleResponse
INFO: Broker Servlet supports GZip compression.
Sep 25, 2017 3:55:26 PM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to http://192.168.31.1:61616
Sep 25, 2017 3:55:27 PM
org.apache.activemq.transport.http.HttpClientTransport$1 handleResponse
INFO: Broker Servlet supports GZip compression.
Sep 25, 2017 3:55:27 PM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to http://192.168.31.1:61616
Sep 25, 2017 3:55:27 PM
org.apache.activemq.transport.http.HttpClientTransport$1 handleResponse
INFO: Broker Servlet supports GZip compression.
Sep 25, 2017 3:55:27 PM
org.apache.activemq.transport.failover.FailoverTransport doReconnect
INFO: Successfully connected to http://192.168.31.1:61616

TomEE reconnects successfully, however, transaction gets failed -

javax.jms.JMSException: Transaction
'XID:[1197822575,globalId=5b100000047544d4944000000000000000000000000000000000000000000000000000,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000]'
has not been started.



Sep 25, 2017 4:29:43 PM org.apache.geronimo.transaction.manager.RollbackTask
run
*SEVERE: Unexpected exception committing
org.apache.geronimo.transaction.manager.WrapperNamedXAResource@6bcc4298;
continuing to commit other RMs
*
javax.transaction.xa.XAException: The connection is already closed
        at
org.apache.activemq.TransactionContext.toXAException(TransactionContext.java:805)
        at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:532)
        at
org.apache.activemq.ra.LocalAndXATransaction.rollback(LocalAndXATransaction.java:141)
        at
org.apache.geronimo.transaction.manager.WrapperNamedXAResource.rollback(WrapperNamedXAResource.java:100)
        at
org.apache.geronimo.transaction.manager.RollbackTask.run(RollbackTask.java:64)
        at
org.apache.geronimo.transaction.manager.ExponentialtIntervalRetryScheduler$TaskWrapper.run(ExponentialtIntervalRetryScheduler.java:50)
        at java.util.TimerThread.mainLoop(Timer.java:555)
        at java.util.TimerThread.run(Timer.java:505)
Caused by: org.apache.activemq.ConnectionClosedException: The connection is
already closed
        at
org.apache.activemq.ActiveMQConnection.checkClosed(ActiveMQConnection.java:1503)
        at
org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1490)
        at
org.apache.activemq.TransactionContext.rollback(TransactionContext.java:516)
               


Error at Broker  -

Exception: Transaction
'XID:[1197822575,globalId=311500000047544d4944000000000000000000000000000000000000000000000000000,branchId=1000000047544d4944000000000000000000000000000000000000000000000000000]'
has not been started.
ctivemq.broker.TransactionBroker.getTransaction(TransactionBroker.java:368)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.broker.TransactionBroker.send(TransactionBroker.java:291)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.broker.MutableBrokerFilter.send(MutableBrokerFilter.java:152)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.broker.TransportConnection.processMessage(TransportConnection.java:496)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.command.ActiveMQMessage.visit(ActiveMQMessage.java:756)[activemq-client-5.10.0.jar:5.10.0]
ctivemq.broker.TransportConnection.service(TransportConnection.java:294)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.broker.TransportConnection$1.onCommand(TransportConnection.java:148)[activemq-broker-5.10.0.jar:5.10.0]
ctivemq.transport.TransportFilter.onCommand(TransportFilter.java:69)[activemq-client-5.10.0.jar:5.10.0]
ctivemq.transport.TransportSupport.doConsume(TransportSupport.java:83)[activemq-client-5.10.0.jar:5.10.0]
ctivemq.transport.http.HttpTunnelServlet.doPost(HttpTunnelServlet.java:143)[activemq-http-5.10.0.jar:5.10.0]
t.http.HttpServlet.service(HttpServlet.java:713)[geronimo-servlet_2.5_spec-1.2.jar:1.2]
t.http.HttpServlet.service(HttpServlet.java:806)[geronimo-servlet_2.5_spec-1.2.jar:1.2]
jetty.servlet.ServletHolder.handle(ServletHolder.java:652)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.servlet.ServletHandler.doHandle(ServletHandler.java:445)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.GzipHandler.handle(GzipHandler.java:301)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1046)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.servlet.ServletHandler.doScope(ServletHandler.java:372)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.ContextHandler.doScope(ContextHandler.java:978)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.Server.handle(Server.java:367)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:486)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:937)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:998)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.http.HttpParser.parseNext(HttpParser.java:861)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.http.HttpParser.parseAvailable(HttpParser.java:235)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)[jetty-all-server-7.6.9.v20130131.jar:7.6.9.v20130131]
read.run(Thread.java:745)[:1.8.0_112]
urred:



How to solve this error?-




--
Sent from: http://tomee-openejb.979440.n4.nabble.com/TomEE-Users-f979441.html