exception description
error when creating queue for message sending
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[miaosha.queue]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:721) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:598) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1504) [spring-rabbit-1.7.9.RELEASE.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
Caused by: java.io.IOException: null
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:105) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:101) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:123) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) ~[amqp-client-4.0.3.jar:4.0.3]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_131]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_131]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_131]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_131]
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:1027) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
at com.sun.proxy.$Proxy261.queueDeclarePassive(Unknown Source) ~[na:na]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:700) ~[spring-rabbit-1.7.9.RELEASE.jar:na]
... 3 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no queue 'miaosha.queue' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:32) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:366) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:229) ~[amqp-client-4.0.3.jar:4.0.3]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:117) ~[amqp-client-4.0.3.jar:4.0.3]
... 12 common frames omitted
solution
miaosha.queue queue could not be found, an inspection found that the queue was not configured in the @configuration file,
add the relevant queue to the configuration class to
@Configuration
public class MQConfig {
public static final String MIAOSHA_QUEUE = "miaosha.queue";
@Bean
public Queue miaoShaQueue(){
return new Queue(MIAOSHA_QUEUE,true);
}
}
div>
Read More:
- rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s)-2021-10-09
- Processing method of SVN error “failed to run the WC DB work queue associated with…”
- Resolve the exception MySQL lontransientconnectionexception: communications link failure during rollback()
- Cause analysis and solution of “SVN: e155009: failed to run the WC DB work queue associated with”
- Ambqpioexception of rabbitmq error: java.io.ioexception
- RabbitMQ login failed
- Resolve the idea error unable to Ping server at localhost: 1099 exception
- Python uses the priority queue to get the maximum k elements
- Unexplained exception 005: uncaught error: can’t resolve all parameters for applicationmodule
- Login failed in rabbitmq
- How to Fix error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarE
- Failed to instantiate org.mybatis.spring.SqlSessionTemplate Constructor threw exception
- Error: unable to resolve dependency for… Could not resolve project
- RabbitMQ Startup Script (How to Set)
- Solved: elasticsearch error: exception [type = search]_ phase_ execution_ exception, reason=all shards failed]
- error: unknown type name ‘Q_DECLARE_METATYPE‘
- rabbitmq management Login Failed
- Failed to resolve: failed to resolve
- Window installation of MongoDB exception: connect failed exception
- TNS-03505: Failed to resolve name – accidental error!