Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The QoS of retained messages should depend on subscribers #288

Merged
merged 8 commits into from
Aug 9, 2019

Conversation

gnought
Copy link
Collaborator

@gnought gnought commented Aug 6, 2019

From MQTT 3.1.1 spec

If the RETAIN flag is set to 1, in a PUBLISH Packet sent by a Client to a Server, the Server MUST store the Application Message and its QoS, so that it can be delivered to future subscribers whose subscriptions match its topic name [MQTT-3.3.1-5]

We store the retained message QoS in a persistence store. If the retain message is QoS 1
Subscriber (QoS 2) will get the retained msg in QoS 1
Subscriber (QoS 1) will get the retained msg in QoS 1
Subscriber (QoS 0) will get the retained msg in QoS 0 (downgraded)

gnought added 8 commits July 22, 2019 03:33
broker not store zero-byte retained messages
[MQTT-3.3.1-5] If the RETAIN flag is set to 1, in a PUBLISH Packet sent by a Client to a Server, the Server MUST store the Application Message and its QoS, so that it can be delivered to future subscribers whose subscriptions match its topic name
We store the retained message QoS in a persistence store. If the retain message is QoS 1
Sub (QoS 2) will get the msg in QoS 1
Sub (QoS 1) will get the msg in QoS 1
Sub (QoS 0) will get the msg in QoS 0 (downgraded)
@gnought gnought added the bug label Aug 9, 2019
Copy link
Collaborator

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mcollina mcollina merged commit cb3c3a6 into moscajs:master Aug 9, 2019
@gnought gnought deleted the hotfix/retain_message_delivery_qos branch August 10, 2019 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants