Skip to content

Commit

Permalink
use constant for retry number
Browse files Browse the repository at this point in the history
  • Loading branch information
chillleader authored and sbuettner committed Jul 2, 2024
1 parent 8c7fd66 commit d1718a6
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,15 @@ public KafkaExecutable(
this.retryPolicy = retryConfig;
}

private static final int INFINITE_RETRIES = -1;

public KafkaExecutable() {
this(
KafkaConsumer::new,
RetryPolicy.builder()
.handle(Exception.class)
.withDelay(Duration.ofSeconds(30))
.withMaxAttempts(-1)
.withMaxAttempts(INFINITE_RETRIES)
.build());
}

Expand Down

0 comments on commit d1718a6

Please sign in to comment.