Deleting retained messages under a topic recursively

1,309 views
Skip to first unread message

ahmet....@esensi.com.tr

unread,
Dec 3, 2013, 12:26:04 PM12/3/13
to mq...@googlegroups.com
When deleting the retained message (for example from topic "tmp/a"), HiveMQ won't delete retained messages that have subscribed to topics under it ( say "tmp/a/b" and "tmp/a/b/c"). This means I know and delete each such retained message one by one.

Are there plans to extend the specs to include such a behavior? Are there brokers that support such an operation?

CONFIDENTIALITY NOTICE - ESEN EMAIL: This email and any attachments are confidential, may contain proprietary and protected information, and are intended for the use of the intended recipients only. Any review, reliance, distribution, disclosure, or forwarding of this email and/or attachments outside of ESEN without express written approval of the sender, except to the extent required to further properly approved ESEN business purposes, is strictly prohibited. If you are not the intended recipient of this email, please notify the sender immediately, and delete all copies without reading, printing, or saving in any manner.

Dominik Obermaier

unread,
Dec 4, 2013, 5:03:08 AM12/4/13
to mq...@googlegroups.com
Hi Ahmet,

if you want to remove retained messages with a null message, then you always have - according to the spec - to delete them one by one. This behaviour is implemented in any MQTT broker I know of (which supports retained messages). There are no plans to extend the spec to support such a behaviour. At least I don't know of such plans.

In case of HiveMQ, you can write a plugin [1] which implements the behaviour you want easily with a onPublishCallback. There is a management/operations application in development for HiveMQ which eases these operations. I invite you to contact me directly if you are interested in that.


Dominik


[1] http://www.hivemq.com/docs/plugins/1.4.0/
[2] http://www.hivemq.com/docs/plugins/1.4.0/#onPublish-callback

ahmet....@esensi.com.tr wrote:
--
--
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
 
---
You received this message because you are subscribed to the Google Groups "MQ Telemetry Transport" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Dominik Obermaier

unread,
Apr 22, 2014, 6:49:19 PM4/22/14
to mq...@googlegroups.com
Hi Ahmet,

there is now a HiveMQ plugin available which adds your desired behaviour to HiveMQ. Every retained message on a subtopic will be deleted as well if a retained message is removed on a topic. You can download the plugin here: http://www.hivemq.com/plugin/delete-retained-messages-recursively-plugin/

Best,
Dominik

Ahmet Cepoğlu

unread,
Apr 23, 2014, 2:44:31 AM4/23/14
to mq...@googlegroups.com
Hey Dominik,

I have taken the liberty to write one myself :) It's good that others have felt the same need to develop one, as I don't have the rights over mine to share it; I can't even remove the confidentiality notice signature from my emails...

Thanks for your response though.

Bye


--
To learn more about MQTT please visit http://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.

To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To post to this group, send email to mq...@googlegroups.com.
Visit this group at http://groups.google.com/group/mqtt.
For more options, visit https://groups.google.com/d/optout.

Roger Light

unread,
Apr 23, 2014, 6:22:35 AM4/23/14
to mq...@googlegroups.com
I must have missed this topic the first time round. There is a utility
in the Paho Python repository that can clear retained topic patterns:
http://git.eclipse.org/c/paho/org.eclipse.paho.mqtt.python.git/tree/examples/mqtt_clear_retain.py

Cheers,

Roger
Reply all
Reply to author
Forward
0 new messages