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
847 stars 158 forks source link

No ack sent on message redelivery after a reconnect #526

Closed cabsil closed 1 year ago

cabsil commented 2 years ago

Hello,

We are facing what we think to be an issue.

Here is the scenario :

After investigation with Wireshark, we found out the reason. For some reason the HiveMQ Client doesn't send a puback in that case. So the broker doesn't get informed of the ack in the HiveMQ Client.

Here is the callback :

  callback(publish -> {
               onMessageReceived(publish.toString());

                boolean success = true;
                if (mqttConfiguration.getAck().getStrictMode()) {
                    try {
                        success = function.apply(new HiveMqttMessage(publish));
                    }
                    catch (Exception ex)
                    {
                        success = false;
                        log.error("Error when {} received message: {}", getIdentifier(), publish.toString());
                    }
                }
                if (success) {
                    publish.acknowledge();
                }
            })

We think this is a bug but maybe we are doing something wrong. In the second case, could you tell us how to handle our scenario ?

Regards

Christophe Absil

pglombardo commented 1 year ago

Hi @cabsil - have you had any updates on this? This shouldn't be the case.

If it still persists, could you tell us:

pglombardo commented 1 year ago

Hi @cabsil - since I haven't heard back I'll close out this issue. But if the problem still exists, let us know - we'd love to help out. Feel free to re-open or file another issue if that's the case!