Skip to content

Commit

Permalink
Fix broken example code 'retry(When' -> 'retryWhen'
Browse files Browse the repository at this point in the history
  • Loading branch information
acktsap committed Oct 26, 2023
1 parent f535b9c commit bf33c9f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit bf33c9f

Please sign in to comment.