Moved params out of publishQos2

This commit is contained in:
andsel
2016-12-13 23:43:02 +01:00
parent 2640a5354c
commit da94a6a014
3 changed files with 14 additions and 20 deletions
@@ -11,8 +11,6 @@ import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.util.concurrent.ConcurrentMap;
import static io.moquette.spi.impl.BestEffortMessageSender.createPublishForQos;
class PersistentQueueMessageSender {
private static final Logger LOG = LoggerFactory.getLogger(PersistentQueueMessageSender.class);
@@ -22,19 +20,14 @@ class PersistentQueueMessageSender {
this.connectionDescriptors = connectionDescriptors;
}
void publishQos2(ClientSession clientsession, String topic, AbstractMessage.QOSType qos,
ByteBuffer message, int messageID) {
void publishQos2(ClientSession clientsession, PublishMessage pubMessage) {
String clientId = clientsession.clientID;
LOG.debug("directSend invoked clientId <{}> on topic <{}> QoS {} retained {} messageID {}",
clientId, topic, qos, false, messageID);
PublishMessage pubMessage = createPublishForQos(topic, qos, message);
clientId, pubMessage.getTopicName(), pubMessage.getQos(), false, pubMessage.getMessageID());
//set the PacketIdentifier only for QoS > 0
pubMessage.setMessageID(messageID);
LOG.info("send publish message to <{}> on topic <{}>", clientId, topic);
LOG.info("send publish message to <{}> on topic <{}>", clientId, pubMessage.getTopicName());
if (LOG.isDebugEnabled()) {
LOG.debug("content <{}>", DebugUtils.payload2Str(message));
LOG.debug("content <{}>", DebugUtils.payload2Str(pubMessage.getPayload()));
}
if (connectionDescriptors == null) {