springboot版本:2.1.0.RELEASE
在springboot项目中搭配rabbitmq队列使用,消费者需要手动创建,不然生产者发送消息之后,无法接收到消息。
@RabbitListener(queuesToDeclare = @Queue("destinationName"))
只要使用queuesToDeclare属性即可,会自动创建该消费者。
springboot版本:2.1.0.RELEASE
在springboot项目中搭配rabbitmq队列使用,消费者需要手动创建,不然生产者发送消息之后,无法接收到消息。
@RabbitListener(queuesToDeclare = @Queue("destinationName"))
只要使用queuesToDeclare属性即可,会自动创建该消费者。