Mosquitto: Win10 - database not saved

Created on 10 Nov 2020  路  3Comments  路  Source: eclipse/mosquitto

I start the broker (Version 1.6.8) under Windows 10 as follows and not as a service:

start "mosquitto.exe" /MIN "mosquitto.exe" -c mosquitto.conf -v

The configuration is:

autosave_interval 0
persistence true
persistence_file my_mosquitto.db

All publish messages were sent as retained message and QoS=1.
But when i close the broker no my_mosquitto.db file is written.

When I change the configuration to:

autosave_interval 5
persistence true
persistence_file my_mosquitto.db

Every 5 seconds the my_mosquitto.db file is written.

Why does the first configuration not work?
What do I do wrong?

Thanks

Most helpful comment

As this is issue/pull request number 1883, which is the MQTT port number, here is a special badge for you :)
1883-badge

All 3 comments

I think the most likely explanation here is that when you close the broker it is completely terminating the broker rather than signalling that it should close and letting the broker close and write the persistence file. I'll see if I can reproduce it.

As this is issue/pull request number 1883, which is the MQTT port number, here is a special badge for you :)
1883-badge

I think the most likely explanation here is that when you close the broker it is completely terminating the broker rather than signalling that it should close and letting the broker close and write the persistence file. I'll see if I can reproduce it.

that's my guess too, how can i terminate the broker right?
at the moment I close the broker with taskkill:

taskkill /f /im mosquitto.exe

or when I'm testing, with close button from the cmd-window

I only need the database when the broker breaks down or windows is rebooted and the broker starts again

Was this page helpful?
0 / 5 - 0 ratings