diff --git a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java index 51122cafda..d87118dae4 100755 --- a/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java +++ b/activemq-client/src/main/java/org/apache/activemq/ActiveMQConnection.java @@ -1587,19 +1587,13 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon c.dispose(); } - if (isConnectionInfoSentToBroker) { - if (!transportFailed.get() && !closing.get()) { - syncSendPacket(info.createRemoveCommand()); - } - isConnectionInfoSentToBroker = false; - } if (userSpecifiedClientID) { info.setClientId(null); userSpecifiedClientID = false; } clientIDSet = false; - started.set(false); + stop(); } /** diff --git a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java index 0b676139e9..45e702897e 100755 --- a/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java +++ b/activemq-ra/src/main/java/org/apache/activemq/ra/ActiveMQManagedConnection.java @@ -234,7 +234,7 @@ public class ActiveMQManagedConnection implements ManagedConnection, ExceptionLi try { physicalConnection.cleanup(); } 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 { // defer transaction cleanup till after close so that close is aware of the current tx localAndXATransaction.cleanup();