ARTEMIS-1286 Fixing MQTT Bytes message encode

This commit is contained in:
Clebert Suconic 2018-03-14 16:36:38 -04:00
parent 0d47f62710
commit a7333bcf9d
1 changed files with 3 additions and 2 deletions

View File

@ -278,8 +278,9 @@ public class MQTTPublishManager {
log.warn("Unable to send message: " + message.getMessageID() + " Cause: " + e.getMessage(), e);
}
default:
ActiveMQBuffer bufferDup = message.getReadOnlyBodyBuffer();
payload = bufferDup.readBytes(bufferDup.writerIndex()).byteBuf();
ActiveMQBuffer bodyBuffer = message.getReadOnlyBodyBuffer();
payload = ByteBufAllocator.DEFAULT.buffer(bodyBuffer.writerIndex());
payload.writeBytes(bodyBuffer.byteBuf());
break;
}
session.getProtocolHandler().send(messageId, address, qos, isRetain, payload, deliveryCount);