DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
...
public class KafkaShareConsumer<K, V> {
/**
* Acknowledge records within the provided session.
*/
public void acknowledgeTransactionally(
TransactionSession session,
Map<TopicPartition, Set<Long>> acknowledgments
);
}
```...
3. Proposed Changes
3.1 Architecture: Before and After
...
Dedicated Connection - Maintains its own connection to the coordinator broker.
4. Use Cases
4.1 Apache Flink: Lightweight Transaction Completion
...
Architectural comparison:
...
5. Compatibility, Deprecation, and Migration Plan
5.1 Full Backward Compatibility
...
No deprecations. The KafkaProducer convenience methods remain the recommended API for simple produce-and-commit patterns. TransactionSession is for advanced use cases: 2PC, cross-entity transactions, external coordinators.
...
6. Security
6.1 Authorization
TransactionSession requires the same ACLs as the current producer transaction API:
...
The session identity is not multiplied -- there is one session, one producerId, one epoch, regardless of how many clients use it
...
7. Test Plan
...
7.1 Unit Tests
| Test | Description |
| Session Lifecycle | Verify transitions: UNINITIALIZED → INITIALIZING → READY → IN_TRANSACTION → COMMITTING → READY. |
| Session Resume | Verify resume() starts in IN_TRANSACTION and can execute commitTransaction(). |
| Heartbeat Logic | Verify heartbeat thread lifecycle based on transaction.session.timeout.ms. |
| Producer Fencing | Ensure KafkaProducer throws IllegalStateException on lifecycle calls when using an external session. |
| Backward Compatibility | Verify standard KafkaProducer transaction methods work via internal session delegation. |
| Epoch Fencing | Verify that a new session with the same transactional.id correctly fences the older session. |
| Identity Accessors | Ensure producerId(), producerEpoch(), and transactionalId() are accurate post-initialization. |
...
7.2 Integration Tests
Producer + external session E2E
Resume and commit from different process
...
7.3 Compatibility Tests
| Test | Description |
| Legacy Producer | Run existing test suite on KafkaProducer without external sessions to ensure zero regression. |
| Mixed Mode | Run internal and external sessions concurrently on the same cluster to verify no interference. |
9. Reference
KIP-98 - Exactly Once Delivery and Transactional Messaging
...
