Shivam Seth <shivam.jma@xxxxxxxxx> writes:
> If this is not right place to ask questions, Please guide me to correct
> path.
It seems right.
> I am using *python** based paho mqtt client*.
> When MQTT broker get disconnected, the messages at mqtt client will be
> buffered, which are there to be publish to broker.
paho python is a library. Did you write code to use the library?
SHIVAM : Yes, I have written some code and used paho library to create client, connect to broker and publish message to mosquitto broker.
> So I wanted to understand, How long that message will be buffered on
> client, or when it will be dropped by mqtt client?
Can you point to where in the docs this should be explained and what you
found there?
SHIVAM : I didn't found any information documented. I have done one practical
- Start mosquitto broker on command prompt.
- Start python script to connect("127.0.0.1", port=1883, keep_alive=60) to mosquitto broker. (start publishing message's in background, using start_loop() function )
- Kill terminal on which mosquitto was running
-
- Python client will try to re-connect to server internally. (This functionality is in start_loop() )
- After sometime Start mosquitto broker again on command prompt
- Paho client code will internally re-connect and publish the message.
After facing such situation, I got doubt that it is buffering such messages, (On debugging paho client library code , I found there is a variable called _out_messages which is python ordered dictionary and holding messages.
Not having a clue, I would expect that when the process exits, the
pending messages are lost. I would also perhaps expect some largish
limit on buffered messages, which when exceeed perhaps results in
dropping old ones, and perhaps results in an error.
> I wanted to log such messages which are not published and drop at client
> itself?
I would suggest reading the source code.
SHIVAM : I am doing that, I wanted to understand, Is there any standard specification about such messages.