提交 945694a4 编写于 作者: 浅梦2013's avatar 浅梦2013

mica-mqtt-core 放开 tio 队列配置。

上级 429ba344
...@@ -160,6 +160,14 @@ public class MqttServerCreator { ...@@ -160,6 +160,14 @@ public class MqttServerCreator {
* 节点名称,用于处理集群 * 节点名称,用于处理集群
*/ */
private String nodeName; private String nodeName;
/**
* 是否用队列发送
*/
public boolean useQueueSend = true;
/**
* 是否用队列解码(系统初始化时确定该值,中途不要变更此值,否则在切换的时候可能导致消息丢失)
*/
public boolean useQueueDecode = false;
public String getName() { public String getName() {
return name; return name;
...@@ -410,6 +418,24 @@ public class MqttServerCreator { ...@@ -410,6 +418,24 @@ public class MqttServerCreator {
return this; return this;
} }
public boolean isUseQueueSend() {
return useQueueSend;
}
public MqttServerCreator useQueueSend(boolean useQueueSend) {
this.useQueueSend = useQueueSend;
return this;
}
public boolean isUseQueueDecode() {
return useQueueDecode;
}
public MqttServerCreator useQueueDecode(boolean useQueueDecode) {
this.useQueueDecode = useQueueDecode;
return this;
}
public MqttServer build() { public MqttServer build() {
Objects.requireNonNull(this.messageListener, "Mqtt Server message listener cannot be null."); Objects.requireNonNull(this.messageListener, "Mqtt Server message listener cannot be null.");
// 默认的节点名称,用于集群 // 默认的节点名称,用于集群
......
...@@ -209,6 +209,7 @@ import org.tio.utils.hutool.StrUtil; ...@@ -209,6 +209,7 @@ import org.tio.utils.hutool.StrUtil;
import org.tio.websocket.common.*; import org.tio.websocket.common.*;
import org.tio.websocket.common.util.BASE64Util; import org.tio.websocket.common.util.BASE64Util;
import org.tio.websocket.common.util.SHA1Util; import org.tio.websocket.common.util.SHA1Util;
import org.tio.websocket.server.WsServerAioHandler;
import org.tio.websocket.server.handler.IWsMsgHandler; import org.tio.websocket.server.handler.IWsMsgHandler;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
...@@ -222,7 +223,7 @@ import java.util.*; ...@@ -222,7 +223,7 @@ import java.util.*;
* @author L.cm * @author L.cm
*/ */
public class MqttWebServerAioHandler implements ServerAioHandler { public class MqttWebServerAioHandler implements ServerAioHandler {
private static Logger log = LoggerFactory.getLogger(org.tio.websocket.server.WsServerAioHandler.class); private static final Logger log = LoggerFactory.getLogger(WsServerAioHandler.class);
/** /**
* value: List<WsRequest> * value: List<WsRequest>
*/ */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册