Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to use Kafka transactional producers #223

Merged
merged 21 commits into from
Oct 24, 2023

Conversation

mateusjunges
Copy link
Owner

@mateusjunges mateusjunges commented Oct 7, 2023

Closes #217

Transactional producers

Transactions provide the guarantee of atomicity, consistency, isolation, and durability (ACID) for a group of messages that are published to Kafka. This means that either all messages within the transaction will be successfully written to Kafka or none of the messages will be written. This is a crucial feature when it comes to ensuring data consistency and avoiding any data loss.

When using Kafka with transactional producers, each producer MUST configure its own static and unique transactional.id. This configuration option is used to uniquely identify the same logical producer across process restarts.

To guarantee message ordering, a given producer can have at most one ongoing transaction, and they are executed serially.

Consuming messages from transactional producers

When consuming messages from transactional producers it is important to set the isolation.level property of your consumer to read_committed, which will prevent consumers from advancing to offsets which includes open transactions. Messages from aborted transactions are filtered out within the consumer, and are never observed by the client application.

@mateusjunges mateusjunges self-assigned this Oct 7, 2023
@mateusjunges mateusjunges changed the title Add the ability to use Kafka transational producers Add the ability to use Kafka transactional producers Oct 7, 2023
@mateusjunges mateusjunges merged commit 6d54dab into v2.x Oct 24, 2023
4 checks passed
@mateusjunges mateusjunges deleted the feat/transational-producer branch October 24, 2023 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant