英文:
JAVA Paho mqtt - publish to wildcard
问题
如何使用 Paho MQTT 发布到通配符(通配符)?
当尝试发布到 /client/#
时,我会得到以下日志:
英文:
how can I publish to a wildcard with Paho mqtt?
I get the following log when trying to publish to /client/#
答案1
得分: 2
一个客户端只能向一个单独的主题发布有效载荷,不能在发布时使用通配符来匹配主题。
你只能在订阅主题时使用通配符(#+)。
资源:
http://www.steves-internet-guide.com/understanding-mqtt-topics
https://stackoverflow.com/questions/54476930/publish-multiple-topics-in-one-message-mqtt
英文:
A client can publish a payload to a single topic only, you can't use wildcards for topics while publishing.
You can use wildcards(#+) only for subscribing to the topics.
Resources:
http://www.steves-internet-guide.com/understanding-mqtt-topics
https://stackoverflow.com/questions/54476930/publish-multiple-topics-in-one-message-mqtt
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论