diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java index b2dd9be386..8e0c416811 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/MQTTSocket.java @@ -80,7 +80,7 @@ public class MQTTSocket extends AbstractMQTTSocket implements WebSocketListener try { getProtocolConverter().onMQTTCommand(new DISCONNECT().encode()); } catch (Exception e) { - LOG.warn("Failed to close WebSocket", e); + LOG.debug("Failed to close MQTT WebSocket cleanly", e); } } diff --git a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java index a419e71dc1..ee012dbed5 100644 --- a/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java +++ b/activemq-http/src/main/java/org/apache/activemq/transport/ws/jetty9/StompSocket.java @@ -64,11 +64,11 @@ public class StompSocket extends AbstractStompSocket implements WebSocketListene public void onWebSocketClose(int arg0, String arg1) { try { if (protocolLock.tryLock() || protocolLock.tryLock(ORDERLY_CLOSE_TIMEOUT, TimeUnit.SECONDS)) { - LOG.info("Stomp WebSocket closed: code[{}] message[{}]", arg0, arg1); + LOG.debug("Stomp WebSocket closed: code[{}] message[{}]", arg0, arg1); protocolConverter.onStompCommand(new StompFrame(Stomp.Commands.DISCONNECT)); } } catch (Exception e) { - LOG.warn("Failed to close WebSocket", e); + LOG.debug("Failed to close STOMP WebSocket cleanly", e); } finally { if (protocolLock.isHeldByCurrentThread()) { protocolLock.unlock(); diff --git a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java index dd493469e0..12b54a4eaa 100644 --- a/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java +++ b/activemq-http/src/test/java/org/apache/activemq/transport/ws/StompWSTransportTest.java @@ -283,6 +283,10 @@ public class StompWSTransportTest extends WSTransportTestSupport { service.shutdownNow(); service.awaitTermination(5, TimeUnit.SECONDS); - wsStompConnection.sendFrame(new StompFrame(Stomp.Commands.DISCONNECT)); + try { + wsStompConnection.sendFrame(new StompFrame(Stomp.Commands.DISCONNECT)); + } catch (Exception ex) { + LOG.info("Caught exception on write of disconnect", ex); + } } }