Can JDBC transactions and kafka transactions work together as XA transaction? Does kafka transaction API supports XA transaction?
Kafka has no support for XA transactions. Kafka delegates the burden of exactly-once to the message consumer.
Looking at the "Unsupported Features" section of
https://docs.confluent.io/platform/current/clients/kafka-jms-client/index.html
Transaction (XA or otherwise) are not supported by Kafka.
Both the Producer and the Consumer need to boilerplate an ad-hoc transaction manager 80's style.
I know there is lots of rhetoric floating around in the Spring and Microservices camps that claim everything from Transactions are impossible under the CAP Theorem to Distributed Transactions are proprietary vendor lock-in. And there seems to be a lot of confusion where people think transactions are just a Database thing.
But the reality is we have had interoperable, standardized and opensource XA on remote calls, including both databases, message services, and more since the early 90's
To be honest I don't look at Kafka as a product ready for production use it simply doesn't have the foundational features to support non-trivial message applications. And performance seems to be linked to cranking up the cloud hosting bill.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With