[AMQ-6068] make full cleanup of the rar managed connection conditional on a user specified client id being present

This commit is contained in:
gtully 2017-05-04 11:08:32 +01:00
parent 2b3f0e5958
commit 2bd3379932
2 changed files with 5 additions and 1 deletions

View File

@ -1555,6 +1555,10 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
doCleanup(false);
}
public boolean isUserSpecifiedClientID() {
return userSpecifiedClientID;
}
public void doCleanup(boolean removeConnection) throws JMSException {
if (advisoryConsumer != null && !isTransportFailed()) {
advisoryConsumer.dispose();

View File

@ -232,7 +232,7 @@ public class ActiveMQManagedConnection implements ManagedConnection, ExceptionLi
proxyConnections.clear();
try {
physicalConnection.doCleanup(true);
physicalConnection.doCleanup(physicalConnection.isUserSpecifiedClientID());
} catch (JMSException e) {
throw new ResourceException("Could not cleanup the ActiveMQ connection: " + e, e);
} finally {