NO-JIRA Send MQTT WILL outside of Server Session

This commit is contained in:
Martyn Taylor 2017-02-18 13:31:57 +00:00
parent 06688f5c32
commit 8b51ec27db
1 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,12 @@ public class MQTTPublishManager {
Transaction tx = session.getServerSession().newTransaction(); Transaction tx = session.getServerSession().newTransaction();
try { try {
if (internal) {
session.getServer().getPostOffice().route(serverMessage, tx, true);
} else {
session.getServerSession().send(tx, serverMessage, true, false); session.getServerSession().send(tx, serverMessage, true, false);
}
if (retain) { if (retain) {
boolean reset = payload instanceof EmptyByteBuf || payload.capacity() == 0; boolean reset = payload instanceof EmptyByteBuf || payload.capacity() == 0;
session.getRetainMessageManager().handleRetainedMessage(serverMessage, topic, reset, tx); session.getRetainMessageManager().handleRetainedMessage(serverMessage, topic, reset, tx);