I think a good solution will be the broker retry (throw exception for retry logic). but with a incresing interval. Configure the intreval on the trigger to let’s say 1 second, and use in your flow a delay/sleep step. Based on the retryCount you can increase the interval every time.
RetryCount = 1 - sleep 1 second
RetryCount = 2 - sleep 10 seconds
RetryCount = 3 - sleep 100 seconds
RetryCount = 4 - sleep 1000 seconds
RetryCount = 5 - sleep 10000 seconds, etc.
this way you have retry logic for small network hick ups, but also for long db down times. But only do this if you do not have too much load.
Other solution is to store the data on the file system, and start processing messages from there when the db is up.
probably there are may threads on this forum about this.