Azure / azure-iot-sdk-java

A Java SDK for connecting devices to Microsoft Azure IoT services
https://azure.github.io/azure-iot-sdk-java/
Other
200 stars 237 forks source link

[Bug Report] QOS not set for incoming messages from `$iothub/twin/PATCH/properties/desired/` topic #1746

Closed dzakub closed 1 year ago

dzakub commented 1 year ago

Context

Description of the issue

Messages received from topic: $iothub/twin/PATCH/properties/desired/ do not set QOS properly. This causes ACK message to not to be sent to a broker. Issue was discovered while writing integration tests with fake IOT hub.

Console log of the issue

2023-10-10 17:04:16,262 TRACE - com.hivemq.mqtt.handler.publish.PublishFlowHandler - Client 'iot-hub-fake' completed a PUBLISH flow with QoS 1 or 2 for packet identifier '3'
2023-10-10 17:04:17,026 TRACE - com.microsoft.azure.sdk.iot.device.transport.mqtt.Mqtt - Mqtt message arrived on topic $iothub/twin/PATCH/properties/desired/?$version=2 with mqtt message id 151
2023-10-10 17:04:17,026 INFO  - IotHubFake - IotHubFake: Delivery complete, message id: 3, topics: [$iothub/twin/PATCH/properties/desired/?$version=2], complete: true
2023-10-10 17:06:33,465 TRACE - com.hivemq.mqtt.message.pool.SequentialMessageIDPoolImpl - Tried to return message id 51 although it was already returned. This is could mean a DUP was acked
2023-10-10 17:06:33,465 TRACE - com.microsoft.azure.sdk.iot.device.transport.mqtt.MqttIotHubConnection - Received MQTT device twin message ( Message details: Correlation Id [9410b255-3b4d-4212-bc39-a65962028587] Message Id [0d26490a-371a-474d-83ab-918aba12af34] Device Operation Type [DEVICE_OPERATION_TWIN_SUBSCRIBE_DESIRED_PROPERTIES_RESPONSE] )
2023-10-10 17:06:33,466 TRACE - com.microsoft.azure.sdk.iot.device.transport.mqtt.MqttIotHubConnection - MQTT received message with QoS 0 so it has not been added to the messages to acknowledge list ( Message details: Correlation Id [9410b255-3b4d-4212-bc39-a65962028587] Message Id [0d26490a-371a-474d-83ab-918aba12af34] Device Operation Type [DEVICE_OPERATION_TWIN_SUBSCRIBE_DESIRED_PROPERTIES_RESPONSE] )
dzakub commented 1 year ago

I have fix completed for this issue. But I cannot push it. Do I need some permissions?

timtay-microsoft commented 1 year ago

We can discuss this issue a bit in your PR #1747

timtay-microsoft commented 1 year ago

Version 2.3.1 has been released with this fix, so I'll close this thread