Mqttnet: QoS between Server and ManagedMqttClient

Created on 3 Feb 2020  路  3Comments  路  Source: chkr1011/MQTTnet

Describe the bug

Because of testing, I instantized 2 ManagedMqttClients with 1 MqttServer.
Step 1, connect both clients to server;
Step 2, client A subscribes a Topic;
Step 3, client B publishes to that Topic with QoS = AtLeaseOnce(0x01) or ExactlyOnce(0x02)
Result:
(i) Server's MqttApplicationMessageReceivedEvent works bringing correct QoS value as a property of ApplicationMessage.
(ii) client A's MqttApplicationMessageReceivedEvent (no matter UseApplicationMessageReceivedHandler method or ApplicationMessageReceivedHandler with HandlerDelegate) brings only AtMostOnce(0x00), which modifies the original QoS value.

Which project is your bug related to?

  • ManagedClient
  • Server (MQTTnet.Server.IMqttServer)

To Reproduce

Using this version of MQTTnet '...'.
Revision: 073cd5243fbd6adbe961413db042739d5b272ed3
Author: Christian Kratky christian.kratky@googlemail.com
Date: 10/3/2019 9:23:35 PM
Message:
Update docs. Add UnitTests.

/* omitted, if needed will add

  1. Run this code '....'.
  2. With these arguments '....'.
  3. See error.
    */

Expected behavior

Client A gets the exact QoS given by Client B in ApplicationMessageReceived event.

bug

Most helpful comment

You have to subscribe also setting the maximum level of QoS you want to receive. The default is 0. That's why you always get QoS = 0.

All 3 comments

You have to subscribe also setting the maximum level of QoS you want to receive. The default is 0. That's why you always get QoS = 0.

@jdmartinez That's true.

@grammyleung Were you able to resolve this issue?

Hi, @jdmartinez and @SeppPenner , thank you guys, I will try first and reply here.

Was this page helpful?
0 / 5 - 0 ratings