Imroy / pubsubclient

A client library for the ESP8266 that provides support for MQTT
MIT License
435 stars 115 forks source link

Message published multiple times #74

Open gfoiani opened 7 years ago

gfoiani commented 7 years ago

Hi,

I successfully setup pubsubclient to send messages to my remote MQTT broker (RabbitMQ), but when I publish a message it is published multiple times on the broker (RabbitMQ does not support QoS2). I'm using PublishJSON, the content is correctly received by the broker but it is received multiple times. This is the code, topic is a String and object is a JsonObject&:

MQTT::PublishJSON newpub(topic, object);
mqttClient.publish(newpub.set_qos(1));

Any idea why the message is sent multiple times?

Thanks

marciogranzotto commented 7 years ago

is that not the expected behaviour of QoS 1? It guarantees that your message arrive, but it can arrive multiple times.