it depends on which broker implementation you are using.
With RSMB (and I think mosquitto, but Roger would have to confirm),
you publish a message with an empty payload and the retained flag set.
This clears any previously retained message on that topic.
Regards,
Nick
> --
> To learn more about MQTT please visit http://mqtt.org
>
> To post to this group, send email to mq...@googlegroups.com
> To unsubscribe from this group, send email to
> mqtt+uns...@googlegroups.com
>
> For more options, visit this group at
> http://groups.google.com/group/mqtt
> With RSMB (and I think mosquitto, but Roger would have to confirm),
> you publish a message with an empty payload and the retained flag set.
> This clears any previously retained message on that topic.
This is the case in mosquitto.
Cheers,
Roger
glad to hear it works - means it is unlikely you are using MicroBroker
as that doesn't support this method of clearing retained messages. You
have to use its administration client to clear retained messages
out-of-band of your messaging.
When it became clear we needed a standard in-protocol way of clearing
them, we added the statement:
"A server may delete a retained message if it receives a message with
a zero-length payload and the Retain flag set on the same topic."
Note the "may" - it isn't currently a required feature of brokers.
Cheers,
Nick
> jars/micro.jar:jars/micro-
> mgr.jar:jars/micro-log.jar:jars/micro-registry.jar:jars/micro-
> trace.jar:jars/wmqtt.jar com.ibm.micro.management.Manager -start -
> name=Microbroker
I don't recognise any of those jar files as being what MicroBroker
supplies, nor is com.ibm.micro.management.Manager a class I know of..
but that could easily be a bit of bespoke code someone's written to
startup the broker and the jar files could have been repackaged.
The com.ibm.micro bit _is_ the main MB package, so it is likely you
have got a microbroker under the covers there somewhere.
Curious.
N
> To learn more about MQTT please visit http://mqtt.org
Hi,
> Any client can send this message and the broker clears the retained
> messages on the specific topic for all users?
That's correct. The retained message doesn't belong to any user, so anybody can clear it - assuming they have permission to write to that topic of course.
Cheers,
Roger
--
To learn more about MQTT please visit http://mqtt.org
To post to this group, send email to mq...@googlegroups.com
To unsubscribe from this group, send email to
mqtt+uns...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mqtt