Skip to content

Fix broken example code ('retry(When' -> 'retryWhen') #366

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

Merged
merged 1 commit into from
Oct 26, 2023
Merged
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: 2 additions & 2 deletions src/docs/asciidoc/api-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,8 @@ which will ensure that a new consumer is created:
--------
Flux<ReceiverRecord<Integer, String>> inboundFlux =
KafkaReceiver.create(receiverOptions)
.receive()
.retry(When(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS))));
.receive()
.retryWhen(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS)));
--------

Any errors related to the event processing rather than the `KafkaConsumer` itself should be handled as close to the source as possible
Expand Down
4 changes: 2 additions & 2 deletions src/docs/asciidoc/examples.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ KafkaSender.create(senderOptions)
.send(source.flux().map(r -> transform(r))) // <4>
.doOnError(e-> log.error("Send failed, terminating.", e)) // <5>
.doOnNext(r -> source.commit(r.correlationMetadata())) // <6>
.retry(When(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS))));
.retryWhen(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS)));
--------
<1> Send is acknowledged by Kafka for acks=all after message is delivered to all in-sync replicas
<2> Large number of retries in the producer to cope with transient failures in brokers
Expand Down Expand Up @@ -100,7 +100,7 @@ KafkaReceiver.create(receiverOptions)
.publishOn(aBoundedElasticScheduler) // <4>
.concatMap(m -> sink.store(transform(m)) // <5>
.doOnSuccess(r -> m.receiverOffset().commit().block())) // <6>
.retry(When(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS))))
.retryWhen(Retry.backoff(3, Duration.of(10L, ChronoUnit.SECONDS)));
--------
<1> Disable periodic commits
<2> Disable commits by batch size
Expand Down