Status
Current state: Under Discussion
Discussion thread: TBD
JIRA:
Please keep the discussion on the mailing list rather than commenting on the wiki (wiki discussions get unwieldy fast).
Motivation
Kafka Producer supports transactional semantics since 0.11, including the following APIs:
- InitTransaction for transactional producer identity initialization
- beginTransaction to start a new transaction
- sendOffsetsToTransaction to commit consumer offsets advanced within the current transaction
- commitTransaction commit the ongoing transaction
- abortTransaction abort the ongoing transaction
Public Interfaces
We should add a new exception type called TransactionStateCorruptedException, which wraps non-fatal retriable producer txn exception.
public class TransactionStateCorruptedException extends ApiException { public TransactionStateCorruptedException(String message, Throwable cause) { super(msg, cause); } }
Proposed Changes
Below is a full list of exception types that could be thrown from producer API as of today
- ProducerFencedException
- InvalidProducerEpochException
- KafkaException, which potentially wraps the following exceptions:
- IllegalStateException
- InvalidPidMappingException
- TransactionAbortedException
- ClusterAuthorizationException
- TransactionalIdAuthorizationException
- UnsupportedVersionException
- KafkaException which indicates retriable idempotent sequence
- KafkaException which indicates fatal transactional sequence
Compatibility, Deprecation, and Migration Plan
- What impact (if any) will there be on existing users?
- If we are changing behavior how will we phase out the older behavior?
- If we need special migration tools, describe them here.
- When will we remove the existing behavior?
Rejected Alternatives
If there are alternative ways of accomplishing the same thing, what were they? The purpose of this section is to motivate why the design is the way it is and not some other way.