【RabbitMQ】07-业务幂等处理
@RabbitListener(bindings = @QueueBinding(
value = @Queue(name = "direct.queue1"),
exchange = @Exchange(name = "hmall.direct", type = ExchangeTypes.DIRECT),
key = {"red", "yellow"}
))
public void topicLister1(Message msg) {
log.info("测试" + msg.getMessageProperties().getMessageId());
System.out.println(new String(msg.getBody()));
// throw new RuntimeException("用于测试的异常");
}