We have been building a bunch of micro services using Apache Kafka as a messaging bus to communicate between them. Some micro services also interact with a database or a JMS message broker (IBMM MQ) or both.
We had lots of problems caused by the fact that Kafka does not guaranty exactly once
resulting in lots of efforts put in place to prevent duplicates happening. In addition to this the performance we achieved is far for what is being advertised.
Because low latency is one of our main requirements as a Prof Of Concept we replaced Kafka topics with Chronicle Queues and gave it a go. Depending on the batch sizes and how hard we smashed our systems in terms of TPS (transactions per second) it came as a nice surprise that Chronicle version was anywhere between six times to two hundreds times faster than the Kafka version with an average of at least ten times faster.
Anyway low latency is only one of the requirements. Data consistency is paramount. Under no circumstances we would like to duplicate a message or loose one. Going through Chronicle Queue documentation as well as searching the web did not take me anywhere about how to use Chronicle Queue in a transactional way. Considering integration with some other resources (JMS + DB) some XA transaction like would be preferred.
So my question is what are the common patterns applied when using Chronicle Queue to assure data consistency? A link to some good article or some suggestions or a bit of code example to put me on the right direction would would suffice.
Thank you in advance.