Where is published message stored by mosquitto broker if offline

0 votes
I'm using the Eclipse paho to publish messages with the mosquitto broker and when both my publisher and subscriber are both connected, I'm successfully able to receive the message. And, even if I disconnect the subscriber, I still get the messages upon reconnecting it. That means there must be a storage somewhere on the broker level where these messages get stored while the subscriber is offline. I just really wanted to know how many such messages can be stored on broker level while subscriber is offline
I'm publishing messages through the broker in paho with QOS=2 through a session persistence using clean_session=false. So, will this be feasible for a real-time GPS tracker where there are chances of my subscriber being offline for hours together, also how much traffic can it take for a scalable application? And, is my session persistence still in place when offline?
Aug 10, 2018 in IoT (Internet of Things) by Bharani
• 4,660 points
3,790 views

1 answer to this question.

+1 vote
Well, of course, they are stored! That is the main idea behind session persistence and if I'm correct, a 32-bit mosquitto broker uses a huge disk space of storage, like at least more than 1 GB for sure.
And, the file being written to disk in the mosquitto.conf file autosave* and persistence* options is 'mosquitto.db' and you can control where it is being written. But, I hope you don't have abnormally large lengths in your messages! It is a common problem though, avoid doing that! And, it will still depend on factors like how many publishers or subscribers you have or your message rates. Also, the session persistence is also maintained in the same .db file so that its state just resumes upon the broker starting again or the subscriber coming online.
answered Aug 10, 2018 by nirvana
• 3,130 points

Related Questions In IoT (Internet of Things)

0 votes
1 answer

What is the maximum message length for a MQTT broker?

It's not entirely clear what you're asking ...READ MORE

answered Jul 17, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points
9,463 views
0 votes
1 answer

What is the time taken by a 200 byte message for transmission in a beacon-enabled network?

Now, data rates of IEEE 802.15.4 are ...READ MORE

answered Aug 24, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
889 views
0 votes
1 answer

Testing if messages from my Device is reaching the Azure IoT Hub?

Download the Device Explorer open source tool ...READ MORE

answered Aug 10, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
3,864 views
0 votes
1 answer

What kind of server is used by IoT?

So, IoT does not really need a ...READ MORE

answered Jan 28, 2019 in IoT (Internet of Things) by Shubham
• 13,490 points
631 views
0 votes
1 answer
0 votes
1 answer

Eclipse Paho: read data from MQTT Broker

From what I could analyze, you've been ...READ MORE

answered Aug 9, 2018 in IoT (Internet of Things) by DataKing99
• 8,250 points
2,450 views
0 votes
1 answer

Mosquitto broker- Horizontally scaling

For accuracy, let me mention that other ...READ MORE

answered Sep 5, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
2,611 views
0 votes
1 answer

MQTT protocol connection error

Ok so you need two libraries to ...READ MORE

answered Jul 6, 2018 in IoT (Internet of Things) by anonymous2
• 4,240 points

reshown Jul 6, 2018 by Vardhan 3,067 views
0 votes
1 answer

MQTT pubish is slow to send with ESP8266 & NodeMCU

I think you're almost correct and on ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
3,266 views
0 votes
1 answer

MQTT broker for Google App Engine

You had a hard time finding anything ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,130 points
1,525 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP