Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Persistency problem

I suspect that this is related to the max_queued_messages configuration parameter, which defaults to 100. Queued messages above the limit are not stored in the persistence file.

On Thu, Aug 27, 2015 at 10:23 AM, Gerrit Dijkstra <gerrit.dijkstra@xxxxxxxxxxxxxxxxxxx> wrote:

I'm facing a persistency problem: having mosquitto broker configured to be persistent for 1 day, I see data gaps when a subscriber is stopped and restarted some time later. Topics are published with qos=1.
I would expect that topics remain persistent for at maximum one day (see config below)!
My question: is this a bug, a misunderstanding from my side or a configuration issue?

I Tested this on mosquitto version 1.3.5 and 1.4.2, both with same result.

The configuration I used:
persistent_client_expiration 1d
autosave_interval 1000
autosave_on_changes true
persistence true
persistence_file mosquitto.db
persistence_location /var/lib/mosquitto/

For testing, I use the command line tool:
mosquitto_sub -h <host> -t # -u <user> -P <pwd> -i <id> -c -q 1 -v 

I do this twice, both with a specific id and redirect output to specific files.
After receiving some topics, I stop one of the subscribers for a while (1 - 15 hrs).
After restart of the subscriber, there are exactly 100 topics received. These topics are those which were published directly after the subscriber stop. Then a long time nothing, followed by the normal behavior, receiving topics from the moment of subscriber start.

I see that the persistence file (mosquitto.db) is not growing as expected, but updated only once in >10 days.

I did the same experiment as described above, except for autosave_on_changes to be false.
In this case I stopped mosquitto, the publischer and the subscribers, removed the persistence file and started all over again.
After stopping one of the subscribers, I see the persistence file grow from time to time.
However, the problem remains, but now the block of exactly 100 topics is in the middle of the 'gap'.

Thanks for your support.


Met vriendelijke groet / Kind regards,

Gerrit Dijkstra

R&D Engineer

mosquitto-dev mailing list
To change your delivery options, retrieve your password, or unsubscribe from this list, visit

Back to the top