activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtruchado <>
Subject Re: activemq-client does not close properly connections to the broker
Date Tue, 13 May 2014 09:41:35 GMT
Hi again,

I got some more time to dig into this, I found the place where It is

I have here the sources for activemq-client 5.8.0.redhat-60024 (please note
that I'm using JBoss AMQ 6.0, this is a product released by RedHat that uses
internally Activemq 5.8.0)

The sources that I'm using can be found here:

My configuration includes a failover between two brokers, both configured
with openwire connection.

I'm not using any openwire attributes, so the configuration is the default

As you suggested, I put a break point in the place where the socket is being
closed, this is in my sources here:

class TcpTransport, line 537

    protected void doStop(ServiceStopper stopper) throws Exception {
        if (LOG.isDebugEnabled()) {
            LOG.debug("Stopping transport " + this);

        // Closing the streams flush the sockets before closing.. if the
        // is hung.. then this hangs the close.
        // closeStreams();
        if (socket != null) {
            if (closeAsync) {
                //closing the socket can hang also
                final CountDownLatch latch = new CountDownLatch(1);

                // need a async task for this
                final TaskRunnerFactory taskRunnerFactory = new
                taskRunnerFactory.execute(new Runnable() {
                    public void run() {
                        LOG.trace("Closing socket {}", socket);
                        try {
                            LOG.debug("Closed socket {}", socket);
                        } catch (IOException e) {
                            if (LOG.isDebugEnabled()) {
                                LOG.debug("Caught exception closing socket "
+ socket + ". This exception will be ignored.", e);
                        } finally {

Exactly at this point, when the socket is close I can see the warning in
ActiveMQ log

2014-05-13 11:27:37,754 | WARN  | 1.77:54043@12270 | Transport                       
|  238 | 104 -
org.apache.activemq.activemq-osgi - 5.8.0.redhat-60024 | Transport
Connection to: tcp:// failed:
Connection reset

Should I raise a bug with this?


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message