JAVA Paho mqtt – publish to wildcard

huangapple go评论101阅读模式
英文:

JAVA Paho mqtt - publish to wildcard

问题

如何使用 Paho MQTT 发布到通配符(通配符)?

当尝试发布到 /client/# 时,我会得到以下日志:

JAVA Paho mqtt – publish to wildcard

英文:

how can I publish to a wildcard with Paho mqtt?

I get the following log when trying to publish to /client/#

JAVA Paho mqtt – publish to wildcard

答案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

huangapple
  • 本文由 发表于 2020年10月18日 13:35:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/64410064.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定