Potential missing message during failover in a HA group

@rdesoju , Further to what @aaron has said, you’ve said you’re using non-blocking send. That means errors (for instance a NACK, which is the broker telling you it couldn’t accept the message) are returned asynchronously, as you’ve seen through the event handler. More to the point you can’t assume the message has been sent until you’ve processed the acknowledgement, which is where responseReceived comes in - here you can mark the message as successfully sent. Until this has happened, you have to keep your data around in case you get an error. See the persistence tutorial for more details.

So if you do get an error, it’s up to you to decide what to do. Re-send? Stop execution? It’s a business decision. But the message is only lost if you haven’t kept it until you’ve been told it’s been accepted by the broker.