首页新闻找找看学习计划

springboot整合rabbitmq后,配置了2个服务源,但是在启动程序后,没有加@primay注解的 连接源上不能自动创建队列,

0
悬赏园豆:30 [已解决问题] 解决于 2019-10-21 11:26

报错信息如下:
org.springframework.amqp.rabbit.listener.BlockingQueueConsumer$DeclarationException: Failed to declare queue(s):[springCloudBus.anonymous.ea2yroF8QcKrryZRJm4gBQ]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:633) ~[spring-rabbit-2.0.0.M4.jar:na]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.start(BlockingQueueConsumer.java:532) ~[spring-rabbit-2.0.0.M4.jar:na]
at org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer$AsyncMessageProcessingConsumer.run(SimpleMessageListenerContainer.java:915) [spring-rabbit-2.0.0.M4.jar:na]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_201]
Caused by: java.io.IOException: null
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:116) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.wrap(AMQChannel.java:112) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:134) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:992) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.ChannelN.queueDeclarePassive(ChannelN.java:50) ~[amqp-client-4.1.0.jar:4.1.0]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_201]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_201]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_201]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_201]
at org.springframework.amqp.rabbit.connection.CachingConnectionFactory$CachedChannelInvocationHandler.invoke(CachingConnectionFactory.java:965) ~[spring-rabbit-2.0.0.M4.jar:na]
at com.sun.proxy.$Proxy135.queueDeclarePassive(Unknown Source) ~[na:na]
at org.springframework.amqp.rabbit.listener.BlockingQueueConsumer.attemptPassiveDeclarations(BlockingQueueConsumer.java:612) ~[spring-rabbit-2.0.0.M4.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 'springCloudBus.anonymous.ea2yroF8QcKrryZRJm4gBQ' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.utility.ValueOrException.getValue(ValueOrException.java:66) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:36) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel$BlockingRpcContinuation.getReply(AMQChannel.java:398) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:244) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:128) ~[amqp-client-4.1.0.jar:4.1.0]
... 12 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 'springCloudBus.anonymous.ea2yroF8QcKrryZRJm4gBQ' in vhost '/', class-id=50, method-id=10)
at com.rabbitmq.client.impl.ChannelN.asyncShutdown(ChannelN.java:505) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.ChannelN.processAsync(ChannelN.java:336) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.handleCompleteInboundCommand(AMQChannel.java:154) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQChannel.handleFrame(AMQChannel.java:101) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQConnection.readFrame(AMQConnection.java:641) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQConnection.access$300(AMQConnection.java:47) ~[amqp-client-4.1.0.jar:4.1.0]
at com.rabbitmq.client.impl.AMQConnection$MainLoop.run(AMQConnection.java:579) ~[amqp-client-4.1.0.jar:4.1.0]
... 1 common frames omitted

在配置类中通过@bean注解 声明队列也不生效~~求大佬指点!!!!

队长给我球。的主页 队长给我球。 | 菜鸟二级 | 园豆:373
提问于:2019-09-24 15:29
< >
分享
最佳答案
0

配置多mq服务源,需要配置各自的工厂和admin

队长给我球。 | 菜鸟二级 |园豆:373 | 2019-10-21 11:26
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册