【问题标题】:Spring cloud stream binder with Azure Eventhub使用 Azure Eventhub 的 Spring 云流绑定器
【发布时间】:2020-11-30 16:53:40
【问题描述】:

我在启动应用程序中收到以下警告消息;可能是什么问题?

提供的 errorChannel 'x.y.errors' 是 DirectChannel 的一个实例,因此不能再添加订阅者,也不会向全局错误通道发送错误消息。解决方法:将自己的errorChannel配置为PublishSubscribeChannel的实例

我的配置如下所示:

public interface CloudStreamConfig extends Source {

    String somethingIn = "somethingIn";
    String somethingOut= "somethingOut";
    String error= "topicname.some-service.errors";

    @Input(CloudStreamConfig.somethingIn)
    SubscribableChannel somethingIn();

    @Output(CloudStreamConfig.somethingOut)
    MessageChannel somethingOut();
}

Application yml:

cloud:
  azure:
    eventhub:
      connection-string: ${EVENTHUB_CONNECTION_STRING}
      checkpoint-storage-account: ${STORAGE}
      checkpoint-access-key: ${ACCESS_KEY}
  stream:
    bindings:
      somethingIn:
        destination: topic-name
        group: some-service
      somethingOut:
        destination: topic-name
        group: some-service

【问题讨论】:

    标签: spring-cloud-stream spring-cloud-stream-binder-kafka


    【解决方案1】:

    最好的猜测是你有一个 @ServiceActivator 从绑定的错误通道消费。

    如果是这样,如果您还希望将错误也发送到全局错误通道,则需要将该通道显式定义为PublishSubscribeChannel @Bean;如果没有,您可以忽略该消息。

    【讨论】:

      猜你喜欢
      • 2021-08-07
      • 2020-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-11
      • 2017-03-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多