Skip to content

Commit

Permalink
Update transactional producer docs
Browse files Browse the repository at this point in the history
Adds note on concurrent access performance constraints
  • Loading branch information
janstenpickle committed Mar 8, 2022
1 parent 8f9c1e9 commit 53d548b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docs/src/main/mdoc/transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ Kafka transactions are supported through a [`TransactionalKafkaProducer`][transa

- Create `CommittableProducerRecords` and wrap them in `TransactionalProducerRecords`.

> Note that calls to `produce` are sequenced in the `TransactionalKafkaProducer` to ensure that, when used concurrently, transactions don't run into each other resulting in an invalid transaction transition exception.
>
> Because the `TransactionalKafkaProducer` waits for the record batch to be flushed and the transaction committed on the broker, this could lead to performance bottlenecks where a single producer is shared among many threads.
> To ensure the performance of `TransactionalKafkaProducer` aligns with your performance expectations when used concurrently, it is recommended you create a pool of transactional producers.
Following is an example where transactions are used to consume, process, produce, and commit.

```scala mdoc
Expand Down

0 comments on commit 53d548b

Please sign in to comment.