It looks a little more complicated than I expected, and there are reasons why it would be impossible to come with the STOMP library with an automatic transition to another resource. For example, if the STOMP application uses transactions, etc., it would be quite difficult to maintain state in the STOMP library and repeat transactions with the new broker after a failure.
Thus, most libraries (even stomp.py) provide fault tolerance support only when connecting to brokers for the first time. Later, the application should take care of the failure.
I have successfully implemented this in my application for our purposes.
source share