Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore retries to default, since idempotency is guaranteed #1227

Open
wants to merge 2 commits into
base: series/3.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/src/main/mdoc/producers.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,6 @@ ProducerSettings(

### Default Settings

The following Java Kafka producer properties are overridden by default.

- `max.retries` is set to `0`, to avoid the risk of records being produced out-of-order. If we don't need to produce records in-order, then this can be set to some positive integer value. An alternative is to enable retries and use `withMaxInFlightRequestsPerConnection(1)` or `withEnableIdempotence(true)`. The blog post [Does Kafka really guarantee the order of messages?](https://blog.softwaremill.com/does-kafka-really-guarantee-the-order-of-messages-3ca849fd19d2) provides more detail on this topic.

The following settings are specific to the library.

- `withCloseTimeout` controls the timeout when waiting for producer shutdown. Default is 60 seconds.
Expand Down
4 changes: 1 addition & 3 deletions modules/core/src/main/scala/fs2/kafka/ProducerSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -317,9 +317,7 @@ object ProducerSettings {
keySerializer = keySerializer,
valueSerializer = valueSerializer,
customBlockingContext = None,
properties = Map(
ProducerConfig.RETRIES_CONFIG -> "0"
),
properties = Map.empty,
closeTimeout = 60.seconds
)

Expand Down