diff --git a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java index eee35a6a29..bcab2eaab9 100644 --- a/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java +++ b/artemis-protocols/artemis-amqp-protocol/src/main/java/org/apache/activemq/artemis/protocol/amqp/proton/ProtonServerReceiverContext.java @@ -125,7 +125,7 @@ public class ProtonServerReceiverContext extends ProtonInitializable implements } catch (ActiveMQAMQPNotFoundException e) { throw e; } catch (Exception e) { - e.printStackTrace(); + log.debug(e.getMessage(), e); throw new ActiveMQAMQPInternalErrorException(e.getMessage(), e); } diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java index 93383840e0..631105805f 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/mqtt/imported/MQTTTest.java @@ -1135,6 +1135,14 @@ public class MQTTTest extends MQTTTestSupport { @Test(timeout = 60 * 1000) public void testLinkRouteAmqpReceiveMQTT() throws Exception { + + MQTT mqtt = createMQTTConnection(); + mqtt.setClientId("TestClient"); + BlockingConnection blockingConnection = mqtt.blockingConnection(); + blockingConnection.connect(); + Topic t = new Topic("test", QoS.AT_LEAST_ONCE); + blockingConnection.subscribe(new Topic[]{t}); + AmqpClient client = new AmqpClient(new URI(AMQP_URI), null, null); AmqpConnection connection = client.connect(); @@ -1149,13 +1157,8 @@ public class MQTTTest extends MQTTTestSupport { connection.close(); } - MQTT mqtt = createMQTTConnection(); - mqtt.setClientId("TestClient"); - BlockingConnection blockingConnection = mqtt.blockingConnection(); try { - blockingConnection.connect(); - Topic t = new Topic("test", QoS.AT_LEAST_ONCE); - blockingConnection.subscribe(new Topic[] {t}); + blockingConnection.subscribe(new Topic[]{t}); assertNotNull(blockingConnection.receive(5, TimeUnit.SECONDS)); } finally { blockingConnection.kill(); @@ -1900,7 +1903,6 @@ public class MQTTTest extends MQTTTestSupport { getServer().waitForActivation(10, TimeUnit.SECONDS); } - } @Test