提交 3610a36b 编写于 作者: 如梦技术's avatar 如梦技术 🐛

mqtt server topicFilters 校验。

上级 239a8495
......@@ -245,7 +245,13 @@ public class DefaultMqttServerProcessor implements MqttServerProcessor {
// 1. 校验订阅的 topicFilter
List<MqttTopicSubscription> topicSubscriptions = message.payload().topicSubscriptions();
if (!authHandler.isValidSubscribe(topicSubscriptions)) {
Tio.remove(context, "Subscribe - clientId:{} topicFilters Verification failed ");
logger.error("Subscribe - clientId:{} topicFilters verification failed", messageId);
// 3. 返回 ack
MqttMessage subAckMessage = MqttMessageBuilders.subAck()
.addGrantedQos(MqttQoS.FAILURE)
.packetId(messageId)
.build();
Tio.send(context, subAckMessage);
return;
}
// 2. 存储 clientId 订阅的 topic
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册