Skip to content
This repository has been archived by the owner on Aug 7, 2020. It is now read-only.

Howto remove retain flag? #103

Open
RaymondMouthaan opened this issue Feb 11, 2019 · 1 comment
Open

Howto remove retain flag? #103

RaymondMouthaan opened this issue Feb 11, 2019 · 1 comment

Comments

@RaymondMouthaan
Copy link
Contributor

Make sure you read and understand https://developer.emqx.io/docs/emq/v3/en/index.html.
Use one of the two templates below and delete the rest.

  • [ x] FEATURE REQUEST

FEATURE REQUEST

remove retain flag from specific topic

Justification

Not sure if it's a bug or a missing feature, but I can't seem to find a way to remove a retain flag from a topic.

Test scenario:

  1. Publish a message1 to a topic with retain: true
  2. Subscribe to topic -> retained message1 is received
  3. Publish an empty message to the topic with retain: false
  4. Subscribe to topic -> retained message1 is received <-- Here no message was expected

Also read this https://medium.com/@emqtt/mqtt-in-a-nutshell-2040b244aa4b, but unfortunately it doesn't explain how to remove the retain flag.

As per https://emqx-enterprise-docs-en.readthedocs.io/en/latest/mqtt.html ...

Client sends an empty message using the same topic of the retained message
should clean retain, but I've tried this with node-red and mqttfx as clients, but it doesn't work.

Workarounds

Only way to remove the retain flag from a topic is to restart the EMQ docker container(s), but this is most probably working since I have persistence not working ...

Please advise.

Regards,
Ray

@turtleDeng
Copy link

A PUBLISH Packet with a RETAIN flag set to 1 and a payload containing zero bytes will be processed as normal by the Server and sent to Clients with a subscription matching the topic name.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants