MQ自动创建队列后,发送消息测试成功,但是order服务端没有显示消息,但报错
来源:7-2 RabbitMQ的基本使用(上)

Dp鸭
2019-03-24
最开始手动创建的队列能发送消息成功,也能成功接收消息,但是用第二种自动创建的队列就出问题了
创建的队列
@Slf4j
@Component
public class MqReceiver {
@RabbitListener(queuesToDeclare = @Queue("myQueque233"))
public void process(String message) {
log.info("MyReceiver: {}",message);
}
}
RabbitMQ 页面创建队列成功
测试发送消息也是成功的
*/
@Component
public class MqReceiverTest extends OrderApplicationTests {
@Autowired
private AmqpTemplate amqpTemplate;
@Test
public void send() {
amqpTemplate.convertAndSend("myQueue233","NOW "+ new Date());
}
}
order控制台就出问题了,没有消息
最后看RabbitMQ页面,myQueue233那个队列 没有任何相应
写回答
2回答
-
采纳答案吧
012019-03-27 -
Dp鸭
提问者
2019-03-24
卧槽 解决了,队列名字没对应,打的太快出错了 。。。。
10
SpringCloud Finchley(M2+RELEASE+SR2)微服务实战
SpringCloud组件实现微服务,【已升级Finchley.Release】
5672 学习 · 2489 问题
相似问题