package com.prolog.upcloud.base.wh.operate.mq;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.amqp.rabbit.support.CorrelationData;

public class RabbitConfirmCallback implements RabbitTemplate.ConfirmCallback {

	private static Logger log = LoggerFactory.getLogger(RabbitConfirmCallback.class);

	@Override
	public void confirm(CorrelationData correlationData, boolean ack, String cause) {
		log.info("(start)生产者消息确认=========================");
		log.info("correlationData:[{}]", correlationData);
		log.info("ack:[{}]", ack);
		log.info("cause:[{}]", cause);
		if (!ack) {
			log.info("消息可能未到达rabbitmq服务器");
		}
		log.info("(end)生产者消息确认=========================");
	}
}
