Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Kafka supports XA transactions?

Can JDBC transactions and kafka transactions work together as XA transaction? Does kafka transaction API supports XA transaction?

like image 434
Vishal Pawar Avatar asked Oct 16 '22 10:10

Vishal Pawar


2 Answers

Kafka has no support for XA transactions. Kafka delegates the burden of exactly-once to the message consumer.

like image 181
steve Avatar answered Oct 21 '22 00:10

steve


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.

like image 29
Chris Avatar answered Oct 21 '22 00:10

Chris