Moved params out of publishQos0

This commit is contained in:
andsel
2016-12-13 23:43:02 +01:00
parent da94a6a014
commit 3100d835df
3 changed files with 4 additions and 6 deletions
@@ -20,11 +20,11 @@ class BestEffortMessageSender {
this.connectionDescriptors = connectionDescriptors; this.connectionDescriptors = connectionDescriptors;
} }
void publishQos0(ClientSession clientsession, String topic, ByteBuffer message, PublishMessage pubMessage) { void publishQos0(ClientSession clientsession, PublishMessage pubMessage) {
String clientId = clientsession.clientID; String clientId = clientsession.clientID;
LOG.info("send publish message to <{}> on topic <{}>", clientId, topic); LOG.info("send publish message to <{}> on topic <{}>", clientId, pubMessage.getTopicName());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("content <{}>", DebugUtils.payload2Str(message)); LOG.debug("content <{}>", DebugUtils.payload2Str(pubMessage.getPayload()));
} }
if (connectionDescriptors == null) { if (connectionDescriptors == null) {
@@ -62,7 +62,7 @@ class MessagesPublisher {
//QoS 0 //QoS 0
if (qos == AbstractMessage.QOSType.MOST_ONE) { if (qos == AbstractMessage.QOSType.MOST_ONE) {
PublishMessage publishMsg = BestEffortMessageSender.createPublishForQos(topic, MOST_ONE, message); PublishMessage publishMsg = BestEffortMessageSender.createPublishForQos(topic, MOST_ONE, message);
this.bestEffortSender.publishQos0(targetSession, topic, message, publishMsg); this.bestEffortSender.publishQos0(targetSession, publishMsg);
} else { } else {
//QoS 1 or 2 //QoS 1 or 2
int messageId = targetSession.nextPacketId(); int messageId = targetSession.nextPacketId();
@@ -1,6 +1,5 @@
package io.moquette.spi.impl; package io.moquette.spi.impl;
import io.moquette.parser.proto.messages.AbstractMessage;
import io.moquette.parser.proto.messages.PublishMessage; import io.moquette.parser.proto.messages.PublishMessage;
import io.moquette.server.ConnectionDescriptor; import io.moquette.server.ConnectionDescriptor;
import io.moquette.spi.ClientSession; import io.moquette.spi.ClientSession;
@@ -8,7 +7,6 @@ import io.netty.channel.Channel;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
class PersistentQueueMessageSender { class PersistentQueueMessageSender {