`

protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCK

    博客分类:
  • MQ
 
阅读更多

 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-08-27 11:37:10.017 ERROR 22436 --- [  restartedMain] o.s.boot.SpringApplication               : Application run failed

org.springframework.context.ApplicationContextException: Failed to start bean 'org.springframework.amqp.rabbit.config.internalRabbitListenerEndpointRegistry'; nested exception is org.springframework.amqp.AmqpIllegalStateException: Fatal exception on listener startup
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:184)
    at org.springframework.context.support.DefaultLifecycleProcessor.access$200(DefaultLifecycleProcessor.java:52)
    at org.springframework.context.support.DefaultLifecycleProcessor$LifecycleGroup.start(DefaultLifecycleProcessor.java:356)
    at org.springframework.context.support.DefaultLifecycleProcessor.startBeans(DefaultLifecycleProcessor.java:157)
    at org.springframework.context.support.DefaultLifecycleProcessor.onRefresh(DefaultLifecycleProcessor.java:121)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:884)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh(ServletWebServerApplicationContext.java:161)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:552)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:140)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:752)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:388)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:327)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1246)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1234)
    at com.demo.RabbitmqConsumerBootstrap.main(RabbitmqConsumerBootstrap.java:15)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: org.springframework.amqp.AmqpIllegalStateException: Fatal exception on listener startup
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer.doStart(SimpleMessageListenerContainer.java:503)
    at org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer.start(AbstractMessageListenerContainer.java:1164)
    at org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistry.startIfNecessary(RabbitListenerEndpointRegistry.java:280)
    at org.springframework.amqp.rabbit.listener.RabbitListenerEndpointRegistry.start(RabbitListenerEndpointRegistry.java:235)
    at org.springframework.context.support.DefaultLifecycleProcessor.doStart(DefaultLifecycleProcessor.java:181)
    ... 19 common frames omitted
Caused by: org.springframework.amqp.rabbit.listener.QueuesNotAvailableException: Cannot prepare queue for listener. Either the queue doesn't exist or the broker will not allow us to use it.
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:619)
    at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:964)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[TestDirectQueue3]
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:711)
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:587)
    ... 2 common frames omitted
Caused by: java.io.IOException: null
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:126)
    at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:122)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:144)
    at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:991)
    at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:52)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:981)
    at com.sun.proxy.$Proxy137.queueDeclarePassive(Unknown Source)
    at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:690)
    ... 3 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'TestDirectQueue3' in vhost '/', class-id=50, method-id=10)
    at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66)
    at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36)
    at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:494)
    at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:288)
    at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:138)
    ... 12 common frames omitted
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=405, reply-text=RESOURCE_LOCKED - cannot obtain exclusive access to locked queue 'TestDirectQueue3' in vhost '/', class-id=50, method-id=10)
    at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:504)
    at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:346)
    at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:178)
    at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:111)
    at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:643)
    at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47)
    at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:581)
    ... 1 common frames omitted

 

MQ生产者创建队列时,属性exclusive设置成true会导致监听不到队列。

exclusive:是否排外的,有两个作用,一:当连接关闭时connection.close()该队列是否会自动删除;二:该队列是否是私有的private,如果不是排外的,可以使用两个消费者都访问同一个队列,没有任何问题,如果是排外的,会对当前队列加锁,其他通道channel是不能访问的,如果强制访问会报异常。

分享到:
评论

相关推荐

    spring-xmemcached

    &lt;value&gt;${XMemcached_servers}&lt;/value&gt; &lt;/property&gt; &lt;!-- server's weights --&gt; &lt;property name="weights"&gt; &lt;list&gt; &lt;value&gt;1&lt;/value&gt; &lt;value&gt;2&lt;/value&gt; &lt;value&gt;3&lt;/value&gt; &lt;/list&gt; &lt;/property&gt; ...

    登录页面源码

    top active"&gt;Log In&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;li class="signup-top-parent"&gt;&lt;a href="https://dash.readme.io/signup" class="signup-top"&gt;Sign Up&lt;span&gt;&lt;/span&gt;&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/div&gt;&lt;/nav&gt;&lt;/header&gt;&lt;div class...

    cas 配置client 1.0 &2.0 及proxy DEMO 说明

    &lt;description&gt;cas1 demo&lt;/description&gt; &lt;!-- cas filter --&gt; &lt;filter&gt; &lt;filter-name&gt;CAS Filter&lt;/filter-name&gt; &lt;filter-class&gt; edu.yale.its.tp.cas.client.filter.CASFilter &lt;/filter-class&gt; &lt;!-- ...

    https安全設定大全

    &lt;forms loginUrl="~/Account/Login" timeout="20" cookieless="UseDeviceProfile" slidingExpiration="true" requireSSL="true" /&gt; &lt;/authentication&gt; &lt;/system.web&gt; ``` 设置`requireSSL`为`true`确保Cookie仅...

    js学习.txt

    &lt;jdbc-driver-params&gt; &lt;!--driver-name&gt;gov.gfmis.dblistener.ojdbc.... &lt;global-transactions-protocol&gt;OnePhaseCommit&lt;/global-transactions-protocol&gt; &lt;/jdbc-data-source-params&gt; &lt;/jdbc-data-source&gt;

    sina33备份的文件20150609_2100.7z

    spi_sclk = port:PC02&lt;3&gt;&lt;default&gt;&lt;default&gt;&lt;default&gt; spi_cs0 = port:PC03&lt;3&gt;&lt;1&gt;&lt;default&gt;&lt;default&gt; [spi1] (关闭SPI1) spi_used = 0 spi_cs_bitmap = 1 spi_cs0 = port:PA00&lt;2&gt;&lt;1&gt;&lt;default&gt;&lt;default&gt; spi_sclk ...

    Linux下搭建tomcat集群全记录

    &lt;Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"&gt; &lt;Context path="" docBase="myapp" /&gt; &lt;/Host&gt; &lt;/Engine&gt; &lt;/Service&gt; &lt;Service name="Tomcat-B"&gt; &lt;Connector port="7080" ...

    firewalld防火墙实操

    - **命令格式**:`firewall-cmd --zone=&lt;zone&gt; --add-port=&lt;port&gt;/&lt;protocol&gt; [--permanent]` - **示例**:`firewall-cmd --zone=public --add-port=20400/tcp --permanent` - **解释**:此命令表示在`public`区域...

    oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

    SQL&gt;conn scott/tiger@orcl 2)zip格式包安装配置(只以basic包做为示例) 2.1 下载包:oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.zip 2.2 将包文件解压到指定目录下: #unzip oracle-instantclient...

    FileZilla FTP Client 3.9.0.1

    状态: local:D:\我的文档\桌面\oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.i686.rpm =&gt; remote:/disk/oracleasm-2.6.18-164.el5-debuginfo-2.0.5-1.el5.i686.rpm 状态: 文件传输成功,传输了 2,844 字节 (用时...

    蓝牙协议全套文档-01 Assigned Numbers.rar

    2010-01-08 09:53 &lt;DIR&gt; Protocol Spec 2010-01-08 09:53 &lt;DIR&gt; Qualification Program MyDocDir\Assigned Numbers 的目录 2010-01-08 09:53 &lt;DIR&gt; . 2010-01-08 09:53 &lt;DIR&gt; .. 2010-01-06 09:48 18,472 ...

    spring-boot-mail

    spring.mail.protocol=smtp #邮箱账号名 spring.mail.username=Email_Name #SpringCloud 注册发现 配置 eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka/ #当前服务器端口 server.port=8081

    jsp探针 ver0.1

    if(macAddressPosition &lt;= 0) continue; String macAddressCandidate = line.substring(macAddressPosition + 1).trim(); if(windowsIsMacAddress(macAddressCandidate)) { lastMacAddress = macAddressCandidate; ...

    ftpserver配置方式

    &lt;int:service-activator input-channel="ftpInputChannel" ref="fileProcessor" method="processFile" /&gt; &lt;bean id="fileProcessor" class="com.example.FileProcessor" /&gt; ``` 在这里,`fileProcessor`是你自定义...

    tomcat8 + nginx + memcached + cas 实现负载均衡的配置包

    &lt;WatchedResource&gt;${catalina.base}/conf/web.xml&lt;/WatchedResource&gt; &lt;!-- Uncomment this to disable session persistence across Tomcat restarts --&gt; &lt;!-- &lt;Manager pathname="" /&gt; &lt;Resources ...

    Soap 消息.doc

    &lt;faultcode&gt;soap:Client&lt;/faultcode&gt; &lt;faultstring&gt;Invalid parameter&lt;/faultstring&gt; &lt;detail&gt; &lt;Error xmlns="http://example.com/"&gt; &lt;Code&gt;1001&lt;/Code&gt; &lt;Description&gt;Invalid value for 'intA'&lt;/Description&gt;...

    jboss 7.1.1 Final 的jsp热部署解决方案

    公司的网站系统使用的中间是...&lt;subsystem xmlns="urn:jboss:domain:web:1.0" default-virtual-server="default-host"&gt; &lt;configuration&gt; &lt;jsp-configuration development="true"/&gt; &lt;/configuration&gt; &lt;connector name=...

    第 2-6 课:使⽤ Spring Boot 和 Thymeleaf 演示上传⽂件1

    &lt;form method="post" action="/upload" enctype="multipart/form-data"&gt; &lt;input type="file" name="file" accept="image/*, application/pdf" required/&gt; &lt;button type="submit"&gt;上传&lt;/button&gt; &lt;/form&gt; &lt;/body&gt; ...

    <Reslet1>:Reslet+Spring,配置简单web访问

    &lt;bean class="org.restlet.data.Protocol"&gt; &lt;constructor-arg&gt; &lt;value&gt;http&lt;/value&gt; &lt;/constructor-arg&gt; &lt;constructor-arg&gt; &lt;value&gt;8080&lt;/value&gt; &lt;/constructor-arg&gt; &lt;/bean&gt; &lt;/constructor-arg&gt; &lt;/bean&gt; `...

    OMA DM Protocol 1.2

    OMA DM Protocol 1.2&lt;br&gt;Include:&lt;br&gt;1)OMA-ERELD-DM-V1_2-20060208-C.pdf&lt;br&gt;2)OMA-TS-DM-TNDS-V1_2-20050607-C.pdf&lt;br&gt;3)OMA-TS-DM-StdObj-V1_2-20060208-C.pdf&lt;br&gt;4)OMA-TS-DM-StdObj-V1_2-20060208-C.pdf&lt;br&gt;5)...

Global site tag (gtag.js) - Google Analytics