hornetq/hornetq — pull request #1163 by gaohoward (2013-07-16 08:20:25+00:00)
Title: Bug 963215 : JMS Bridge doesn't work with HA connection factories

https://bugzilla.redhat.com/show_bug.cgi?id=963215

To make JMS Bridge work with HornetQ HA connection factories, A failover event listener is added to the bridge source and target connections. When failover happens, this listener will wait for failover event. If the failover happens successfully, the bridge won't do retry connections.

Some changes has been made to guarantee the correct handling during failover. a new CreateSessionMessageV2 packet type has been added to help correct XA transaction rollback during failover. It is used to pass the current Xid to the new failover connection so that the transaction can be rolled back on the new connection.

To avoid message duplication in AT_MOST_ONCE mode, a hash set is used to store the batch message IDs. It can detect duplicated messages possibly re-delivered after failover and discard them.

Tests are provided for each of the scenarios.