hivemq / hivemq-mqtt-client

HiveMQ MQTT Client is an MQTT 5.0 and MQTT 3.1.1 compatible and feature-rich high-performance Java client library with different API flavours and backpressure support
https://hivemq.github.io/hivemq-mqtt-client/
Apache License 2.0
824 stars 153 forks source link

QOS 1 together with retained messages can lead to looping reconnect cycle (MQTT 5.0) #594

Open joggeli34 opened 10 months ago

joggeli34 commented 10 months ago

🐛 Bug Report

The client closes the connection if a resend message is received during the same connection, which is fine. But when this message is a retained message, following will happen (together with emqx):

  1. Retained message is received
  2. A same message is received as duplicate as it must be resent when it wasn't acknowledged in the former connection.
  3. The connection is closed, same starts again

🔬 How To Reproduce

Steps to reproduce the behavior:

  1. Use QoS 1 with retained messages
  2. Close the connection before ack

Environment

What version of this client are you using?

1.3.2

JVM version?

17

Which MQTT protocol version is being used?

MQTT 5.0

Which MQTT broker (name and version)?

Emqx 5.1.6

📈 Expected behavior

Duplicates of retained messages should be ignored at least once