简体   繁体   English

仅在订阅 mqtt Broker 一个主题的一个用户处发送消息

[英]Send a message at only one user subribed at a one topic of mqtt Broker

I apologize if the question may seem silly.如果这个问题看起来很愚蠢,我深表歉意。

I have a mqtt broker on which I have for example the topic "ChatBox/Chat_1", on this topic there are subcribed many users, but if the master that is subcribed so "ChatBox" wanted to send a message to a single user in Chat_1 without the others receiving it, there is a method or not?我有一个 mqtt 代理,例如我有一个主题“ChatBox/Chat_1”,在这个主题上有很多用户订阅,但是如果订阅的主人那么“ChatBox”想要向 Chat_1 中的单个用户发送消息没有其他人收到,有没有方法?

MQTT Messages are published to topics, not individual clients/users. MQTT 消息发布到主题,而不是单个客户端/用户。 All clients subscribed to the topic will receive all messages published to that topic.订阅该主题的所有客户端都将收到发布到该主题的所有消息。

There is no way to send a message to a specific client without writing a totally custom MQTT broker (which would then be in violation of the spec)如果不编写完全自定义的 MQTT 代理,则无法向特定客户端发送消息(这将违反规范)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM