mirror of
https://github.com/valitydev/claim-management.git
synced 2024-11-06 10:15:22 +00:00
Rafctor params
This commit is contained in:
parent
50ca2ed1dd
commit
0c705f2fc7
@ -1,5 +1,6 @@
|
||||
package com.rbkmoney.cm.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.retry.annotation.EnableRetry;
|
||||
@ -11,19 +12,21 @@ import org.springframework.retry.support.RetryTemplate;
|
||||
@Configuration
|
||||
public class RetryConfig {
|
||||
|
||||
public static final long BACK_OFF_PERIOD = 1000l;
|
||||
public static final int MAX_ATTEMPTS = 3;
|
||||
@Value("${event.sink.retry.backoff.period:1000}")
|
||||
private long backOffPeriod;
|
||||
@Value("${event.sink.retry.max.attempts:3}")
|
||||
private int maxAttempts;
|
||||
|
||||
@Bean
|
||||
public RetryTemplate retryTemplate() {
|
||||
RetryTemplate retryTemplate = new RetryTemplate();
|
||||
|
||||
FixedBackOffPolicy fixedBackOffPolicy = new FixedBackOffPolicy();
|
||||
fixedBackOffPolicy.setBackOffPeriod(BACK_OFF_PERIOD);
|
||||
fixedBackOffPolicy.setBackOffPeriod(backOffPeriod);
|
||||
retryTemplate.setBackOffPolicy(fixedBackOffPolicy);
|
||||
|
||||
SimpleRetryPolicy retryPolicy = new SimpleRetryPolicy();
|
||||
retryPolicy.setMaxAttempts(MAX_ATTEMPTS);
|
||||
retryPolicy.setMaxAttempts(maxAttempts);
|
||||
retryTemplate.setRetryPolicy(retryPolicy);
|
||||
|
||||
return retryTemplate;
|
||||
|
@ -63,3 +63,6 @@ kafka:
|
||||
key-password: kenny
|
||||
server-password: kenny12
|
||||
server-keystore-location: src/main/resources/cert/truststore.p12
|
||||
event.sink.retry:
|
||||
backoff.period: 1000
|
||||
max.attempts: 3
|
Loading…
Reference in New Issue
Block a user