首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用多个绑定器时,无法使用@StreamRetryTemplate创建自定义RetryTemplate

使用多个绑定器时,无法使用@StreamRetryTemplate创建自定义RetryTemplate
EN

Stack Overflow用户
提问于 2019-04-30 21:05:28
回答 1查看 194关注 0票数 0

我正在使用spring cloud stream和多个活页夹。我尝试使用@StreamRetryTemplate创建自定义RetryTemplate。正在创建自定义RetryTempalte的Bean,但未在AbstractBinder中注入。当我尝试使用单个活页夹时,它工作正常。

版本: Greenwich.SR1

自定义重试模板代码片段

代码语言:javascript
复制
@StreamRetryTemplate
public RetryTemplate myRetryTemplate() {
    RetryTemplate retryTemplate = new RetryTemplate();
    SimpleRetryPolicy simple = new SimpleRetryPolicy(4);
    retryTemplate.setRetryPolicy(simple);
    return retryTemplate;
}

application.yml:

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

发布于 2019-04-30 21:19:46

在我看来像是个bug;打开一个issue on GitHub

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55921576

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档