简体   繁体   English

设置 spring.cloud.stream.rabbit.bindings 时出现 QueuesNotAvailableException。<input-channel> .consumer.bindQueue=false</input-channel>

[英]Getting QueuesNotAvailableException when setting spring.cloud.stream.rabbit.bindings.<input-channel>.consumer.bindQueue=false

Following errors I am getting in a single stack trace.出现错误后,我进入了一个堆栈跟踪。 Want to know where did I go wrong.想知道我go哪里错了。

org.springframework.amqp.rabbit.listener.QueuesNotAvailableException: Cannot prepare queue for listener. org.springframework.amqp.rabbit.listener.QueuesNotAvailableException:无法为侦听器准备队列。 Either the queue doesn't exist or the broker will not allow us to use it.要么队列不存在,要么代理不允许我们使用它。

org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[service-myInputChannelName] org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException:无法声明队列:[service-myInputChannelName]

com.rabbitmq.client.ShutdownSignalException: channel error; com.rabbitmq.client.ShutdownSignalException:通道错误; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'service-myInputChannelName' in vhost '/', class-id=50, method-id=10)协议方法:#method<channel.close>(reply-code=404, reply-text=NOT_FOUND - vhost '/' 中没有队列 'service-myInputChannelName', class-id=50, method-id=10)

For my input channel, I have done following configuration对于我的输入通道,我完成了以下配置

spring:
  cloud:
    stream:
      binders:
        mqtt-binder:
          type: rabbit
          defaultCandidate: false
          inheritEnvironment: true
          environment:
            spring:
               rabbitmq:
                  virtual-host: mqtt
      bindings:
        myInputChannelName:
          destination: myInputChannelName
          group: service-myInputChannelName
          content-type: application/json
          consumer:
            concurrency: 10
            maxAttempts: 1
      rabbit:
        bindings:
          myInputChannelName:
            consumer:
              queueNameGroupOnly: true
              prefetch: 5
              ttl: 600000
              bindQueue: false

Java Code Java 代码

@Input("myInputChannelName")
SubscribableChannel myInputChannelNameEvent();

Dependency: org.springframework.cloud:spring-cloud-starter-stream-rabbit:3.2.4依赖:org.springframework.cloud:spring-cloud-starter-stream-rabbit:3.2.4

It is not clear what you expect in this case;不清楚您在这种情况下的期望; bindQueue=false is intended for cases where you want to use a queue that you have defined and bound yourself. bindQueue=false适用于您想要使用自己定义和绑定的队列的情况。

By default, the binder will create the infrastructure that it needs.默认情况下,活页夹将创建它需要的基础设施。

If you set it to false, you have to set it up yourself.如果将其设置为 false,则必须自己设置。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Spring 云 stream 兔子:当兔子服务器不可用时创建队列 - Spring cloud stream rabbit : Queue creation when rabbit server unavailable 在 spring 云 stream 测试中使用嵌入式 Kafka 和自定义通道绑定 - Using embedded Kafka in spring cloud stream test with custom channel bindings 设置 Spring Cloud Rabbit + deadLetter - Setting Spring Cloud Rabbit + deadLetter 我可以使用spring.cloud.stream.bindings吗? <channel> .group何时使用RabbitMQ获得一次准确的交货? - Can I use spring.cloud.stream.bindings.<channel>.group when using RabbitMQ to obtain exactly-once delivery? Spring Cloud Stream Rabbit MQ扇出交换 - Spring Cloud Stream Rabbit MQ fanout exchange 供应商绑定不适用于 spring 云流兔子 - Supplier binding is not working with spring cloud stream rabbit 支持为 spring 云中的每个消费者绑定定义 spring.json.key.type - Support for defining spring.json.key.type for each consumer binding in spring cloud stream bindings 为什么在 Spring Cloud Stream 反应式消费者中遇到异常时会收到 onComplete 信号? - Why am I getting onComplete signal when an exception is encountered in Spring Cloud Stream reactive consumer? 使用 Spring Cloud 流 kafka 绑定消费者和启用 DLQ 覆盖重试尝试 - Override retry attempts with spring cloud stream kafka bindings consumer and DLQ enabled 属性 spring.cloud.stream.bindings 有什么用。<channelname> .consumer.partitioned</channelname> - what is the use of the property spring.cloud.stream.bindings.<channelName>.consumer.partitioned
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM