This commit is contained in:
Martyn Taylor 2017-02-18 13:38:55 +00:00
commit 64b55778aa
1 changed files with 6 additions and 1 deletions

View File

@ -161,7 +161,12 @@ public class MQTTPublishManager {
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);