diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java index 3393879443..f8bd9bf356 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/vm/VMTransport.java @@ -32,6 +32,8 @@ import org.apache.activemq.transport.Transport; import org.apache.activemq.transport.TransportDisposedIOException; import org.apache.activemq.transport.TransportListener; import org.apache.activemq.util.IOExceptionSupport; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** @@ -143,12 +145,6 @@ public class VMTransport implements Transport, Task { // If stop() is called while being start()ed.. then we can't stop until we return to the start() method. if( enqueueValve.isOn() ) { - - // let the peer know that we are disconnecting.. - try { - oneway(DISCONNECT); - } catch (Exception ignore) { - } TaskRunner tr = null; try { @@ -168,6 +164,11 @@ public class VMTransport implements Transport, Task { if (tr != null) { tr.shutdown(1000); } + // let the peer know that we are disconnecting.. + try { + oneway(DISCONNECT); + } catch (Exception ignore) { + } } }