https://issues.apache.org/jira/browse/AMQ-5710 - connection cleanup should not remove connection from the broker

This commit is contained in:
Dejan Bosanac 2015-04-07 17:21:47 +02:00
parent 25c99a6c36
commit c705523cd0
2 changed files with 2 additions and 8 deletions

View File

@ -1587,19 +1587,13 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
c.dispose(); c.dispose();
} }
if (isConnectionInfoSentToBroker) {
if (!transportFailed.get() && !closing.get()) {
syncSendPacket(info.createRemoveCommand());
}
isConnectionInfoSentToBroker = false;
}
if (userSpecifiedClientID) { if (userSpecifiedClientID) {
info.setClientId(null); info.setClientId(null);
userSpecifiedClientID = false; userSpecifiedClientID = false;
} }
clientIDSet = false; clientIDSet = false;
started.set(false); stop();
} }
/** /**

View File

@ -234,7 +234,7 @@ public class ActiveMQManagedConnection implements ManagedConnection, ExceptionLi
try { try {
physicalConnection.cleanup(); physicalConnection.cleanup();
} catch (JMSException e) { } catch (JMSException e) {
throw new ResourceException("Could cleanup the ActiveMQ connection: " + e, e); throw new ResourceException("Could not cleanup the ActiveMQ connection: " + e, e);
} finally { } finally {
// defer transaction cleanup till after close so that close is aware of the current tx // defer transaction cleanup till after close so that close is aware of the current tx
localAndXATransaction.cleanup(); localAndXATransaction.cleanup();