...
Note that for transactions with 2PC enabled the TransactionTimeoutMs
would be set to Integer.MAX_VALUE
-1
.
Let's consider some examples of the state transitions and how the various producer ids and epochs are used.
...
This would flush all the pending messages and transition the producer into a mode where only .commitTransaction
, .abortTransaction,
or .completeTransaction
could could be called (calling other methods, e.g. .send
, in that mode would result in IllegalStateException
being thrown). If the call is successful (all messages successfully got flushed to all partitions) the transaction is prepared. If the 2PC is not enabled, we return the INVALID_TXN_STATE
error.
...