activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Problem of shutting down ActiveMQ client with failover transport running in java container (Karaf)
Date Sun, 04 Dec 2016 15:24:35 GMT
Can you please submit a bug in JIRA for this?  I imagine this is a problem
in lots of places in the codebase, so please suggest a comprehensive look
at the full codebase in addition to adjusting the one catch block you
referenced.

Also, you're better off passing the inner exception via the two-argument
constructor rather than calling e.getMessage().  That way the inner stack
trace is available if the outer exception gets logged.

Tim

On Nov 28, 2016 5:48 AM, "est412" <est412@gmail.com> wrote:

Hello!
I'm using ActiveMQ 5.10.0 client to connect to broker with failover protocol
and it fails to stop from Karaf console in case of massive sending job. Here
is the important part of a stacktrace:

17:31:17,254 | WARN  | pool-47-thread-5 | FailoverTransport                |
sport.failover.FailoverTransport  260 | handleTransportFailure | Transport
(tcp:///*192.168.210.36*:61616@57522) failed, reason:  , attempting to
automatically reconnect
java.io.InterruptedIOException
        at
org.apache.activemq.transport.WireFormatNegotiator.oneway(
WireFormatNegotiator.java:102)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.transport.failover.FailoverTransport.
oneway(FailoverTransport.java:658)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.transport.MutexTransport.oneway(
MutexTransport.java:68)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.transport.ResponseCorrelator.asyncRequest(
ResponseCorrelator.java:81)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.transport.ResponseCorrelator.request(
ResponseCorrelator.java:86)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.ActiveMQConnection.syncSendPacket(
ActiveMQConnection.java:1406)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.ActiveMQSession.syncSendPacket(
ActiveMQSession.java:2018)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.ActiveMQMessageProducer.<init>
(ActiveMQMessageProducer.java:125)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
        at
org.apache.activemq.ActiveMQSession.createProducer(
ActiveMQSession.java:1048)[418:ru.icl.osgi.TestMOMFailover:0.3.9]
.....
17:31:17,267 | INFO  | ActiveMQ Task-2  | FailoverTransport                |
sport.failover.FailoverTransport 1057 | doReconnect | Successfully
reconnected to tcp://*192.168.210.78*:61616

I've found that FailoverTransport.handleTransportFailure() method considers
ANY exception as a transport failure. After that it successully reconnects
and job continues running.
But InterruptedIOException is the consequence of an external job
interruption and not of a transport failure.
So adding the next snippet into the head of
FailoverTransport.handleTransportFailure() method became a solution (or
maybe just a workaround =))  for me:

if (e instanceof InterruptedIOException) {
    throw new InterruptedException("handleTransportFailure is interrupted
due to " + e.getMessage());
}

I've looked at the 5.14.1 sources a little bit and it seems they have the
the same problem to.






--
View this message in context: http://activemq.2283324.n4.
nabble.com/Problem-of-shutting-down-ActiveMQ-client-with-failover-transport-
running-in-java-container-Karaf-tp4719513.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message