activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtruchado <marcos.truch...@gmail.com>
Subject Re: activemq-client does not close properly connections to the broker
Date Tue, 13 May 2014 10:34:08 GMT
IMHO I have here one candidate

class ActiveMQConnection:

The method stop() is called on my stacktrace on the method close(), so first
try to close the ActiveMQ connection, then the transport (which is good).

The method stop() looks like this:

    @Override
    public void stop() throws JMSException {
        checkClosedOrFailed();
        *if (started.compareAndSet(true, false)) {*
            synchronized(sessions) {
                for (Iterator<ActiveMQSession> i = sessions.iterator();
i.hasNext();) {
                    ActiveMQSession s = i.next();
                    s.stop();
                }
            }
        }
    }

when I was debugging the code the condition was always false, the reason is
that the variable (AtomicBoolean) started is never set to true. You can
check this by looking yourself at this class.

It is set only to false when the close() method is invoked, but on the
method start() or on a similar place the invocation to /started.set(true); /
is missing.





--
View this message in context: http://activemq.2283324.n4.nabble.com/activemq-client-does-not-close-properly-connections-to-the-broker-tp4681005p4681084.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message