I'm testing an MQTT client setup with the Eclipse test server. I noticed off
is sent automatically to every topic my client subscribes to, and the retain
flag is set. I can see the logic behind it but so far, I haven't found this broker feature documented anywhere so I was wondering if anyone has had a similar experience or has more details about any documentation for this broker. Is it intended or is the public broker topic-space just global and I'm getting someone's messages?
1 Answer
Without seeing your code so we know what topics you are subscribed to this is really hard to answer.
But, yes this is a totally public broker with a single shared topic space for all users. So it is very likely that you are receiving a message published by a previous user.
It should really only be used to test MQTT client implementations and not for anything of value since at any time anybody could publish to any topic or it could go down (the eclipse broker is set to change URL and implementation soon [July 2019])
-
Thanks, sort of expected that. I'm using the Python Paho library. Here's the code: github.com/brianrho/mqttsn-project, though there's no chance I sent it myself somehow since the string "off" isn't even mentioned anywhere. For tests, I just used generic topics like "led" and "state", apparently too generic since it seems I'm getting someone's messages. Same for a bunch of other public brokers I tried, except they sent different payloads but the same retain flag is set. Jul 8, 2019 at 12:39
-
Why not just run your own mosquitto instance locally, it really isn't hard– hardillbJul 8, 2019 at 13:11
-
It's not a problem really, its just for tests, I just want to be sure of the behaviour I'm seeing. I'll likely run a Mosquitto broker eventually but for now it's just easier to enter an address and port and get connected to a broker. Jul 9, 2019 at 0:02