From 8b51ec27db2e201c604e8178a574e344d73b033f Mon Sep 17 00:00:00 2001 From: Martyn Taylor Date: Sat, 18 Feb 2017 13:31:57 +0000 Subject: [PATCH] NO-JIRA Send MQTT WILL outside of Server Session --- .../artemis/core/protocol/mqtt/MQTTPublishManager.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java index 76f15c09382..f0385dc63df 100644 --- a/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java +++ b/artemis-protocols/artemis-mqtt-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/mqtt/MQTTPublishManager.java @@ -161,7 +161,12 @@ void sendInternal(int messageId, String topic, int qos, ByteBuf payload, boolean Transaction tx = session.getServerSession().newTransaction(); try { - session.getServerSession().send(tx, serverMessage, true, false); + if (internal) { + session.getServer().getPostOffice().route(serverMessage, tx, true); + } else { + session.getServerSession().send(tx, serverMessage, true, false); + } + if (retain) { boolean reset = payload instanceof EmptyByteBuf || payload.capacity() == 0; session.getRetainMessageManager().handleRetainedMessage(serverMessage, topic, reset, tx);