Up retry policy for streams

This commit is contained in:
k.struzhkin 2021-04-02 23:10:27 +03:00
parent f7df8cda27
commit 5d25de5e79
3 changed files with 10 additions and 3 deletions

@ -1 +1 @@
Subproject commit 56606f5cacec1c30ca11088c575e9c285f1f2f40
Subproject commit 1aa72677e975fc0604818362c595dcf84d27c4f0

View File

@ -38,6 +38,10 @@ public class KafkaConfig {
private boolean kafkaSslEnable;
@Value("${kafka.num-stream-threads}")
private int numStreamThreads;
@Value("${kafka.stream.retries-attempts}")
private int retriesAttempts;
@Value("${kafka.stream.retries-backoff-ms}")
private int retriesBackoffMs;
@Bean
public Properties mgInvoiceEventStreamProperties() {
@ -68,8 +72,8 @@ public class KafkaConfig {
props.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 10 * 1000);
props.put(StreamsConfig.CACHE_MAX_BYTES_BUFFERING_CONFIG, 0);
props.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, numStreamThreads);
props.put(StreamsConfig.RETRIES_CONFIG, 5);
props.put(StreamsConfig.RETRY_BACKOFF_MS_CONFIG, 1000);
props.put(StreamsConfig.RETRIES_CONFIG, retriesAttempts);
props.put(StreamsConfig.RETRY_BACKOFF_MS_CONFIG, retriesBackoffMs);
props.put(StreamsConfig.DEFAULT_DESERIALIZATION_EXCEPTION_HANDLER_CLASS_CONFIG,
LogAndFailExceptionHandler.class);
}

View File

@ -52,6 +52,9 @@ service:
kafka:
bootstrap.servers: "localhost:29092"
num-stream-threads: 7
stream:
retries-attempts: 300
retries-backoff-ms: 1000
ssl:
enable: false
keystore-location: src/main/resources/cert/kenny-k.struzhkin.p12