关于链式建立绑定关系
来源:4-3 SpringAMQP用户管理组件-RabbitAdmin应用-2
jaymie
2020-05-05
rabbitAdmin.declareBinding(BindingBuilder
.bind(new Queue("spring.test.topic2.queue", false))
.to(new TopicExchange("spring.test.topic2.exchange", false, false))
.with("test.#"));
这样子去建立绑定关系,会报错,提示404
Channel shutdown: channel error; protocol method: #method<channel.close>(reply-code=404, reply-text=NOT_FOUND - no exchange ‘spring.test.topic2.exchange’ in vhost ‘/’, class-id=50, method-id=20)
就是说无法通过new的方式去创建队列和交换机
写回答
2回答
-
BryantJames
2020-06-06
链式编程绑定没问题,但是创建的时候会报错,如果只是绑定的话可以成功
00 -
阿神
2020-05-05
试试分着创建,这个提示是没有这个exchange,一步步来试试
00
相似问题