0

I am working with eclipse paho and mosquitto. I am sending message with QOS-1 level. I've changed mosquitto configuration as answered in this question.I am using mqtt lens to test. Mosquitto does not send message after disconnection and connection of subscriber.

Community
  • 1
  • 1
curiousmind
  • 185
  • 1
  • 1
  • 8
  • 1
    What's QOS are you subscribing to the messages? Are you using the same client id for the subscriber? Is the clean session flag set to false? – hardillb Jan 17 '17 at 07:23
  • I've used QOS 1 while subscribing. Yeah client id remains same. I've set clean session flag true. – curiousmind Jan 17 '17 at 09:55

1 Answers1

2

Setting clean session to true will tell the broker to remove any messages queued for the client.

You need to set it to false if you want to receive any messages queued for that client.

The guys at HiveMQ have a blog post about persistent sessions and message queueing with MQTT: http://www.hivemq.com/blog/mqtt-essentials-part-7-persistent-session-queuing-messages

hardillb
  • 54,545
  • 11
  • 67
  • 105
  • It worked. In case when subscriber explicitly disconnects with broker on client reconnection i'm getting same message 2 times. – curiousmind Jan 18 '17 at 12:49