We have encountered the following problem aka TransactionRolledBackException:
Transaction completion in doubt due to failover. Forcing rollback of ID:***** at Apache.NMS.ActiveMQ.Connection.SyncRequest(Command command, TimeSpan requestTimeout)
at Apache.NMS.ActiveMQ.Connection.SyncRequest(Command command)
at Apache.NMS.ActiveMQ.TransactionContext.Commit()
at Apache.NMS.ActiveMQ.Session.DoCommit()
at Apache.NMS.ActiveMQ.Session.Commit()
Here's our topology: we have 6 nodes (n1, .., n6) where nodes n1, n3, n5 are clustered master nodes, and n2 is slave of n1, n4 is slave of n3, n6 is slave of n5.
We use transactions in sending and consuming message processes, which means that this exception could be thrown in both. I'm looking for best practices of handling TransactionRolledBackException without needing to rollback all the business logic executed before commit. We have our own application-level library, which allows fast and easy connection to the broker for sending/receiving messages, and we would like to implement into it some code which would handle TransactionRolledBackException for every application using it and provide "once and only once" delivery.
Thanks for your answers in advance