[AMQ-6494] ensure vm transport propagates onCommand exceptions to peer

This commit is contained in:
gtully 2017-04-04 14:17:27 +01:00
parent 0f7561e85a
commit 729766e492
2 changed files with 10 additions and 2 deletions

View File

@ -35,6 +35,7 @@ import org.apache.activemq.transport.ResponseCallback;
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.activemq.wireformat.WireFormat;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -270,7 +271,14 @@ public class VMTransport implements Transport, Task {
Object command = mq.poll();
if (command != null && !disposed.get()) {
tl.onCommand(command);
try {
tl.onCommand(command);
} catch (Exception e) {
try {
peer.transportListener.onException(IOExceptionSupport.create(e));
} catch (Exception ignore) {
}
}
return !mq.isEmpty() && !disposed.get();
} else {
if(disposed.get()) {

View File

@ -137,7 +137,7 @@ public class ThreadExplorer
if (thread != null)
{
out.append("* [" + thread.getName() + "] " + (thread.isDaemon() ? "(Daemon)" : "")
+ " Group: " + thread.getThreadGroup().getName() + "\n");
+ " Group: " + (thread.getThreadGroup() != null ? thread.getThreadGroup().getName() : "") + "\n");
}
else
{