[英]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.