使用多个联编程序时无法使用@StreamRetryTemplate创建自定义RetryTemplate

时间:2019-04-30 13:05:28

标签: spring-cloud-stream

我正在使用带有多个粘合剂的春季云流。我尝试使用@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

1 个答案:

答案 0 :(得分:0)

在我看来像个虫子;打开issue on GitHub