我正在使用带有多个粘合剂的春季云流。我尝试使用@StreamRetryTemplate创建自定义RetryTemplate。正在创建自定义RetryTempalte的Bean,但未将其注入AbstractBinder。 当我尝试使用单一活页夹时,它可以正常工作。
版本: Greenwich.SR1
自定义重试模板代码段
@StreamRetryTemplate
public RetryTemplate myRetryTemplate() {
RetryTemplate retryTemplate = new RetryTemplate();
SimpleRetryPolicy simple = new SimpleRetryPolicy(4);
retryTemplate.setRetryPolicy(simple);
return retryTemplate;
}
application.yml:
server:
port: 7777
spring:
cloud:
stream:
binders:
kafka_binder:
type: kafka
environment:
spring:
cloud:
stream:
kafka:
binder:
brokers: localhost:9092
bindings:
input:
destination: EMPLOYEE-TOPIC-R1-P1
binder: kafka_binder
contentType: application/json
group: so51247113