OH 1.7.x doesn't reconnect to MQTT broker

I found a situation where if my server reboots then OpenHAB starts up first before my MQTT broker, The OH logs show me that the connection to the broker failed which I understand because it wasn’t up and running yet… But a few minutes later it is up and running.

Should OH attempt to reconnect to a broker that failed to connect during OH startup?

Maybe this is something resolved in 1.8.x?

My plan is to delay the start of OpenHAB after a reboot to allow the broker to start up fully.

I don’t know if there is a better approach, but you could try to use your openhab.cfg to read the openhab.cfg in time intervals (and therefore reread the mqtt broker setup):

# The refresh interval for the main configuration file. A value of '-1' 
# deactivates the scan (optional, defaults to '-1' hence scanning is deactivated)

Did not know that… should do the trick as a last resort.

What broker are you using? What OS are you on? You should be able to specify boot order to ensure your broker is booted before openhab.