Why does my subscription to the public MQTT broker receive no messages but my own?

364 Views Asked by At

I'm playing with the MQTT broker at 'broker.emqx.io' and have subscribed clients to the topic '/python/mqtt', which is the default topic in a Github repository containing an example client implementation in Python. My subscribing client is receiving messages published by my publishing client in the example code. In the time I've spent running the code while modifying it apparently no other client in the entire world has published a message to the topic. Is there something magical going on whereby subscribers in my local network receive only messages published from my local network? Or is there just no traffic on the topic?

2

There are 2 best solutions below

0
On BEST ANSWER

The simplest answer is the most likely, there just isn't anybody else running that example code at the same time against the same broker.

1
On

Disclaimer: I can't add comments :(, and this should be more a comment than a answer.

Yet the MQTT standard defines a very flexible set of rules for naming topics, there are some restrictions that arise by practical reasons.

The leading back-slash is accepted by topic filters but it does not provide any benefit, on the contrary, it introduces an unnecessary topic level which is, furthermore, empty. Maybe they introduced it in the topic for demonstrating something or for other reasons they had at that moment, like making people noticing it ;).

There are other characters that also have special meanings, like $, which is often used for naming system-defined topics that publish statistics or other related information.

Most broker documentations provide a short guideline for naming topics, like HiveMQ does.