消息队列rabbitmq
四颗石头
优秀是一种习惯
展开
-
Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest
@springbootTest问题发生今天在编写rabbitmq的消息确认机制(confirm),使用了springbootTest注解来进行测试,出现了以下问题:java.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration o...原创 2019-08-21 17:48:47 · 231 阅读 · 0 评论 -
RabbitMQ消息丢失解决方案之confirm实现
问题产生原因:问题解决:消息队列为了保证消息不会丢失,提供了两种确认机制:1.RabbitMQ事务RabbitMQ 提供的事务功能,就是生产者发送数据之前开启 RabbitMQ 事务channel.txSelect,然后发送消息,如果消息没有成功被 RabbitMQ 接收到,那么生产者会收到异常报错,此时就可以回滚事务channel.txRollback,然后重试发送消息;如果收到了消息...原创 2019-08-21 20:12:43 · 1274 阅读 · 0 评论