After max_queued_bytes is reached, the broker never reconnects.
My setup: Device send mqtt data to the bridge. Mosquitto broker v 2.0.11 configured as bridge, running on Windows 10 Mosquitto broker v 2.0.7 running on Windows server 2016 All messages are send with QoS 1
Bridge conf:
max_queued_bytes 1000000
max_queued_messages 0
persistent_client_expiration 2d
sys_interval 10
autosave_interval 30
persistence true
persistence_file mosquitto.db
persistence_location c:\mosquitto
allow_anonymous true
connection bridge_test1
address serverkpi02:1884
topic logdata/# out 1
cleansession false
idle_timeout 60
keepalive_interval 10
notifications true
restart_timeout 20
start_type lazy
try_private false
Broker v. 2.0.7 conf:
max_inflight_messages 0
max_queued_messages 1000000
persistent_client_expiration 1d
listener 1884
autosave_interval 300
persistence true
persistence_file mosquitto.db
persistence_location c:/mosquitto
I test by enabling a firewall rule that does not allow connection to the port. (1884) If the bridge loses the Internet connection (enable the firewall rule) to the other broker, then data is buffered in memory, and if the Internet connection is established before memory reaches max_queued_bytes (1000000), then all buffered datas are sent. However, if the Internet connection is not established until max_queued_bytes is reached, it will never send any data. I have to stop the broker, remove the persistent file and restart the broker.
It looks like the broker never reconnect again, if the memory usages is above max_queued_bytes
The conflict here is with max_queued_bytes and the lazy reconnect threshold. If you swap to normal bridge mode then it should start working again, and I'll see about fixing the lazy operation.
Thanks - it works :-) Thats fine for me.
even after getting rid of the lazy start I faced similar issues. after so many tests with different configurations, I found that setting max_queued_messages to 0 caused bugs. and when set to a large enough number (in my case 1.000.000.000) it worked fine