//package cn.cecep.talroad.util;
//
//import cn.cecep.talroad.config.ExchangeConfig;
//import cn.cecep.talroad.config.RabbitmqConfig;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.rabbit.connection.CorrelationData;
//import org.springframework.amqp.rabbit.core.RabbitTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
///**
// * @Auther: cjh
// * @Date: 2022-05-07 15:27
// * @Class: MsgProducer
// * @Deseription:
// * @Version V1.0
// */
//@Slf4j
//@Component
//public class MsgProducer implements RabbitTemplate.ConfirmCallback {
//
//
//    @Autowired
//    private RabbitTemplate rabbitTemplate;
//
//    /**
//     * 发送消息-定时判断设备停限产状态
//     *
//     * @param uuid
//     * @param message 消息
//     */
//    public void sendStatusMsg(String uuid, Object message) {
//        rabbitTemplate.setConfirmCallback(this);
//        CorrelationData correlationId = new CorrelationData(uuid);
//        rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_STATUS,message, correlationId);
//    }
//
//    /**
//     * 发送探查消息
//     * @param uuid
//     * @param message
//     */
//    public void sendYieldStatisticMsg(String uuid, Object message) {
//        rabbitTemplate.setConfirmCallback(this);
//        CorrelationData correlationId = new CorrelationData(uuid);
//        rabbitTemplate.convertAndSend(ExchangeConfig.DIRECT_EXCHANGE, RabbitmqConfig.ROUTE_KEY_YIELD,message, correlationId);
//    }
//
//    @Override
//    public void confirm(CorrelationData correlationData, boolean b, String s) {
//        log.info("消息推送交换机状态{},消息ID{}",b,correlationData.getId());
//    }
//}
