SpringCloudStream整合rabibitmq配置出错

img


导入了spring-cloud-starter-stream-rabbit,为什么会报错?

对照一下,binding写前面

spring:
  cloud:
    stream:
      default:
        producer:
          partitionKeyExpression: payload['id'] # 按id字段分区
        consumer:
          max-attempts: 3         # 最多尝试3次
          backOffInitialInterval: 1000 # 重试之前等待1秒
          backOffMultiplier: 2    # 重试策略:加倍退避
          backOffMaxInterval: 5000 # 最多等待5秒
          partitioned: true       # 广播消费
        bindings:
          myOutput:
            destination: myOutputTopic    # 输出主题名称
            contentType: application/json # 消息内容类型
          myInput:
            destination: myInputTopic     # 输入主题名称
            contentType: application/json # 消息内容类型
        binder: defaultRabbit         # 命名绑定器名称
      binders:
        defaultRabbit:
          type: rabbit
          environment:
            spring:
              rabbitmq:
                host: localhost
                port: 5672
                username: guest
                password: guest
                virtual-host: /