question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MQTT Adapter: Close device connection when a telemetry/event message cannot be processed.

See original GitHub issue

A device publishes an event/telemetry message with QoS 1. The MQTT adapter after successfully establishing the device connection, realizes that the message cannot be processed e.g no credit available, the message limit is exceeded etc. In this case the device remains connected and keeps waiting for the PUBACK packet from the Hono.

Similar scenario is when a device publishes a telemtry/event message with QoS 2 (not supported by Hono). In this case, the device remain connected and it keep waiting for the PUBREC packet.

MQTT 3.1.1 spec (MQTT-3.3.5-2) specifies that there is no way to inform the MQTT client that the publish action is not accepted. The server must either make a positive acknowledgement or close the Network Connection.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
sophokles73commented, Jun 21, 2019

With QoS 1 the clients wait for an ACK, as the remote side either sends an ACK, or is expected to close the connection.

At first I didn’t think that this is actually mandated by the spec but in 4.8 this seems to be actually stated as a requirment:

If the Client or Server encounters a Transient Error while processing an inbound Control Packet it MUST close the Network Connection on which it received that Control Packet [MQTT-4.8.0-2]. If a Server detects a Transient Error it SHOULD NOT disconnect or have any other effect on its interactions with any other Client.

So it seems that closing the connection on any problems we encounter processing an incoming message, actually seems to be what the spec expects us to do. In order to keep things simple I would then propose to not make this configurable (yet). If at a later time we find this helpful, we can still add it.

@kaniyan @calohmn @dejanb @ctron WDYT?

0reactions
kaniyancommented, Jun 25, 2019
Read more comments on GitHub >

github_iconTop Results From Across the Web

MQTT Adapter: Close device connection when a telemetry ...
The MQTT adapter after successfully establishing the device connection, realizes that the message cannot be processed e.g no credit available, ...
Read more >
MQTT Adapter :: Eclipse Hono™ Vers.: 1.2
The MQTT adapter by default requires clients (devices or gateway components) to ... message cannot be processed, the connection to the client is...
Read more >
MQTT adapter - Bosch IoT Device Management
The MQTT protocol adapter exposes an MQTT topic hierarchy for publishing messages and events to the Telemetry and Event endpoints of the device...
Read more >
Publishing over the MQTT bridge - Cloud IoT Core
After the device is configured with an MQTT client and connected to the MQTT bridge, it can publish a telemetry event by issuing...
Read more >
MQTT - AWS IoT Core - AWS Documentation
Use the AWS IoT MQTT messaging protocol for your devices. ... the client a DISCONNECT to notify connection closure with a reason code...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found