Status

Current stateUnder 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:

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

  1. ProducerFencedException
  2. InvalidProducerEpochException
  3. KafkaException, which potentially wraps the following exceptions:
    1. IllegalStateException
    2. InvalidPidMappingException
    3. TransactionAbortedException
    4. ClusterAuthorizationException
    5. UnknownProducerIdException
    6. TransactionalIdAuthorizationException
    7. UnsupportedVersionException
    8. AuthenticationException
    9. UnsupportedForMessageFormatException
    10. RuntimeException for detecting more than one inflight request
    11. InvalidRecordException
    12. InvalidRequiredAcksException
    13. NotEnoughReplicasAfterAppendException
    14. NotEnoughReplicasException
    15. RecordBatchTooLargeException
    16. InvalidTopicException
    17. CorruptRecordException
    18. UnknownTopicOrPartitionException
    19. NotLeaderOrFollowerException
    20. KafkaException
      1. indicates retriable idempotent sequence
      2. indicates fatal transactional sequence
      3. indicates Producer closed
      4. unknown reason
    21. TimeoutException which 

Compatibility, Deprecation, and Migration Plan

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.