Failed to declare queue(s):[QUEUE_TENANT_SCAN]

org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[QUEUE_TENANT_SCAN]
	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:700) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.passiveDeclarations(BlockingQueueConsumer.java:584) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:571) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.initialize(SimpleMessageListenerContainer.java:1355) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:1200) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	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:129) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:125) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:147) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:1012) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:46) ~[amqp-client-5.9.0.jar:5.9.0]
	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:1184) ~[spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	at com.sun.proxy.$Proxy65.queueDeclarePassive(Unknown Source) ~[na:na]
	at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:679) [spring-rabbit-2.2.11.RELEASE.jar:2.2.11.RELEASE]
	... 5 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 'QUEUE_TENANT_SCAN' in vhost '/', class-id=50, method-id=10)
	at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:502) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:293) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:141) ~[amqp-client-5.9.0.jar:5.9.0]
	... 14 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 'QUEUE_TENANT_SCAN' in vhost '/', class-id=50, method-id=10)
	at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:517) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:341) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:182) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:114) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:739) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) ~[amqp-client-5.9.0.jar:5.9.0]
	at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:666) ~[amqp-client-5.9.0.jar:5.9.0]
	... 1 common frames omitted

解决:

检查你的队列名,交换机名,绑定key名

已标记关键词 清除标记
相关推荐
<div class="post-text" itemprop="text"> <p>I use RabbitMQ for handling logging between services (written in PHP). If services can't connect to RabbitMQ, they timeout within 3 seconds and try to use a different method for logging. This has been tested and works well with if the RabbitMQ server is down, or behind a firewall. The code that has these timeouts appears to be the in the <code>AMQPStreamConnection</code> class of the <a href="https://github.com/php-amqplib/php-amqplib" rel="nofollow noreferrer">php-amqplib/php-amqplib</a> PHP package as shown below:</p> <pre><code>public function __construct( $host, $port, $user, $password, $vhost = '/', $insist = false, $login_method = 'AMQPLAIN', $login_response = null, $locale = 'en_US', $connection_timeout = 3.0, // here $read_write_timeout = 3.0, // and here $context = null, $keepalive = false, $heartbeat = 0 ) { $io = new StreamIO( </code></pre> <p>Unfortunately, these timeouts don't seem to help me if I am running a massive "Purge queue" operation by clicking the button in the web UI (a queue with over 20 million in size). I wrote some code to log the times during a purge to see what was going wrong:</p> <pre><code>... $this->m_queueName = $queueName; print "creating connecton: " . time() . "<br>"; $connection = new \PhpAmqpLib\Connection\AMQPStreamConnection( $host, $port, $user, $password ); print "creating channel: " . time() . "<br>"; $this->m_channel = $connection->channel(); print "declaring queue: " . time() . "<br>"; $this->m_channel->queue_declare( $queueName, $passive = false, $durable = true, $exclusive = false, $auto_delete = false, $nowait = false, $arguments = null, $ticket = null ); print "queue declared. " . time() . "<br>"; </code></pre> <p>The result being as follows:</p> <pre><code>creating connecton: 1523977606 creating channel: 1523977606 declaring queue: 1523977606 queue declared. 1523977622 hello world: 1523977622 </code></pre> <p>I can see that the connection and channel get created, but the declaration of the queue takes way too long to respond and <strong>I would rather the queue_declare step would timeout in 3 seconds and an Exception be thrown</strong>. Is this possible? What configuration variable(s) do I need to change?</p> </div>
©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页