eclipse / paho.mqtt-sn.embedded-c

Paho C MQTT-SN gateway and libraries for embedded systems. Paho is an Eclipse IoT project.
https://eclipse.org/paho
Other
314 stars 179 forks source link

Subscribe with QoS not working #190

Closed a1lu closed 4 years ago

a1lu commented 4 years ago

Hi, I tried to subscribe a topic with QoS > 0 and publish something into this topic. The result is, The QoS of the received message is only dependent on the QoS of the publisher. AFAIK the QoS level of subscriber and publisher are two different things, like this:

PUBLISHER -> qos_pub -> BROKER -> qos_sub -> SUBSCRIBER

I used the GatewayTester (run testscript including step 1) to make some logs. Test 1:

Test 2:

I would expect a PUBACK from the receiver like in Test2 also in Test1.

Best regards

ty4tw commented 4 years ago

Hi a1lu, You can't expect PUBACK.
It's a spec of MQTT.

According to the specification [MQTT-3.8.4-6],

The Server might grant a lower maximum QoS than the subscriber requested. The QoS of Payload Messages sent in response to a Subscription MUST be the minimum of the QoS of the originally published message and the maximum QoS granted by the Server.

a1lu commented 4 years ago

Ah, too bad. Thanks anyway.