Skip to content

mosquitto_pub with QOS 1 exiting on connection loss instead of queuing message #2187

@JsBergbau

Description

@JsBergbau

According to https://www.hivemq.com/blog/mqtt-essentials-part-6-mqtt-quality-of-service-levels/

grafik

So according to specification sender stores messages until it is successfully delivered.

Execute mosquitto_pub -t test -h <host> -u <user> -P <PW> -l -q 1

Type messages one by one and see that they are received. No simulate some kind of network failure like the broker going away
sudo iptables -A OUTPUT -d <broker_IP>/32 -j REJECT

Now type some messages again in above window so that mosquitto_pub should deliver it after connection is re-established. However after some time an error appears Error: Publish returned 4, disconnecting.
mosquitto_pub exits and all messages after connection problems are lost.

So is the MQTT specification unclear or is this a bug in mosquitto_pub? Personally I think with QOS 1 message should get queued up to a configurable limit before messages get dropped.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions