-
I'm not sure if it is normal behavior or that it is a bug because I can't find it in the MQTT specifications. According to the specification the QoS level between publisher and broker and broker and subscribers can differ and need to be seen as different processes. While testing this I found indeed that when I publish a message from a client using QoS 2, the receiving client that subscribed with QoS 2 will receive a QoS 2 message from the broker and act on that. When I downgrade the receiving client to QoS 1 then the broker sends a message with QoS 1 regardless if the message was published with QoS 2, so that works as specified. Now if I turn it around and publish a message from a client using QoS 1 and subscribe with another client using QoS 2 still this client receives a message from the broker using QoS 1. So it seems that the QoS can be downgraded but not upgraded. To me this seems odd. Can somebody tell me if this is normal behavior, and if so why? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
From my understanding this is not possible. I also understand the RFC in the way you did and implemented the server accordingly. To me this makes sense because the overall end to end communication has a certain QoS level. There is not need to use QoS 2 for one receiver and 0 for the sender. The overall situation will be that the messages may getting lost due to level 0 at the sender. Increasing at the receiver will not affect this at all. So upgrading would require to upgrade at the sender as well which is not supported. |
Beta Was this translation helpful? Give feedback.
-
I do not agree on that. it could be possible that a specific client cannot cope with duplicate messages while other clients have no problem with that then you want to use this mechanism (Qos 2) to make sure that this specific client only receive a single message. The publishing client is not aware of all the subscribers and their requirements on how to receive data and could be publishing on QoS 1. |
Beta Was this translation helpful? Give feedback.
-
Thank you for the clarification. Going over the Mosquitto broker config file I found the option to activate this, using the mosquitto broker. They also specify that it is against the MQTT spec The MQTT specification requires that the QoS of a message delivered to a |
Beta Was this translation helpful? Give feedback.
From my understanding this is not possible. I also understand the RFC in the way you did and implemented the server accordingly.
To me this makes sense because the overall end to end communication has a certain QoS level. There is not need to use QoS 2 for one receiver and 0 for the sender. The overall situation will be that the messages may getting lost due to level 0 at the sender. Increasing at the receiver will not affect this at all. So upgrading would require to upgrade at the sender as well which is not supported.