'MQTT Mosquitto - Persistence file won't autosave(update) after reached the time interval

I have set the time interval for autosave to 30 seconds but the broker won't auto update the persistence file even though it reached the time interval.

This are my settings:

autosave_interval 30
autosave_on_changes true
persistence true
persistence_file mosquitto.db
persistence_location C:\mosquitto\persistence\

I have to manually close the broker in order get the persistence file updated. Is there any other option I need to turned on? or is there any condition?

Thank you in advance.



Solution 1:[1]

Old question but

If autosave_on_changes is enabled, the autosave_interval is interpreted as changes in retained, received and queued messages instead of seconds. The default database file name can be changed with persistence_file.

What I understand from this is, since your autosave_on_changes is set to true, it'll only save when you have 30 messages queued.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 bca