Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
3.6k views
in Technique[技术] by (71.8m points)

spring boot - QueuesNotAvailableException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it

After updating Rabbit MQ version to 3.8 from 3.7 we start getting the below exception

on micro service start up we are getting

{"timestamp":"2021-01-07T12:41:05.738+00:00","class":"org.springframework.amqp.rabbit.connection.CachingConnectionFactory","thread-id":"main","level":"INFO","type":"createBareConnection","logMessage":"Created new connection: rabbitConnectionFactory#5b5e7036:1/SimpleConnection@1e734eee [delegate=amqp://[email protected]:5672/, localPort= 40702]"}
{"timestamp":"2021-01-07T12:41:05.740+00:00","class":"com.rabbitmq.client.impl.ForgivingExceptionHandler","thread-id":"AMQP Connection 172.40.1.237:5672","level":"WARN","type":"log","logMessage":"An unexpected connection driver error occured (Exception message: Connection reset)"}
{"timestamp":"2021-01-07T12:41:06.747+00:00","class":"org.springframework.amqp.rabbit.connection.CachingConnectionFactory","thread-id":"AMQP Connection 172.40.1.237:5672","level":"ERROR","type":"log","logMessage":"Channel shutdown: connection error; protocol method: #method<connection.close>(reply-code=503, reply-text=COMMAND_INVALID - unknown exchange type 'x-delayed-message', class-id=40, method-id=10)"}

we are using spring boot

<artifactId>spring-boot-starter-parent</artifactId>
 <version>2.3.5.RELEASE</version>

 <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-amqp</artifactId>
  </dependency>

we are using RabbitListener to bind and create queue

@RabbitListener(bindings = @QueueBinding(
        value = @Queue(value = "state.Transaction", durable = "true", autoDelete = "false"),
        exchange = @Exchange(value = "state.exchange" , durable = "true"),
        key = "state.Transaction"))
 rabbitmq:
    host: "rabbitmq-1-xyx.internal.xzy.zzz"
    password: test
    username: test

and this test user has all the super permisions rabbitmqctl set_permissions -p / test "." "." ".*"


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...