1

As far as I understand, if you subscribed to a topic with a specific QoS, the subscriber will see only the messages under that topic provided by the MQTT broker with the QoS level equal or lower to that QoS specified at publishing the topic.

In other words,the client who will subscribe, for an exampe, to thetopic = news and with QoS = 1, then he will be able to see any published messages under the topic = news withQoS = 1 OR 0

I subscribed to a topic = news with QoS = 0, this topic was published with QoS = 2, when i connected to the broker, i received te published message but with its QoS = 0, and the second time, I published the same topic but with QoS = 1, and when I subscribed to it with QoS = 0, I received the message but with QoS = 0.

So, since whatever the QoS level is I receive the message but, with its QoS "downgraded", so what?what is the risk? Can any anyone explain?!!

Amrmsmb
  • 1
  • 27
  • 104
  • 226
  • 1
    Which broker are you using? But I think your understanding is wrong, messages will not be filtered if the QOS don't match. The broker will always try to deliver the message, the QOS just controls how hard the broker tries to deliver the message. IIRC the subscriber QOS is dominant (assuming the message makes it to the broker) – hardillb Nov 13 '14 at 17:04
  • hi, thanks for the answe. i am usin mosquitto – Amrmsmb Nov 13 '14 at 20:40

1 Answers1

2

When you make a subscription you are saying to the broker "the maximum QoS that I wish to receive messages at is X". This means that if a message comes in on the topic you are subscribed to at a higher QoS, it will be downgraded just for you. Other clients are not affected. Hopefully the table below clears this up for you.

Subscription QoS | Message QoS | Delivered QoS
=================|=============|==============
       0         |       0     |       0
       0         |       1     |       0
       0         |       2     |       0
                 |             |
       1         |       0     |       0
       1         |       1     |       1
       1         |       2     |       1
                 |             |
       2         |       0     |       0
       2         |       1     |       1
       2         |       2     |       2
ralight
  • 11,033
  • 3
  • 49
  • 59
  • Thank you for he answer. and the table is clear and exactly shows what i received when i was making testing to understand the mqtt rotoco and its specifications. when my message got downgraded is there any disadvantage? – Amrmsmb Nov 14 '14 at 07:49
  • Well not really - you've stated that is the subscription level you are interested in. If a lower qos is a problem for you, you should subscribe at a higher level. – ralight Nov 17 '14 at 10:03