package com.mortals.xhx.base.system.message.impl;

import com.alibaba.fastjson.JSON;
import com.mortals.xhx.base.system.message.MessageCallbackService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.connection.CorrelationData;
import org.springframework.stereotype.Service;


@Service
@Slf4j
public class MessageCallbackServiceImpl implements MessageCallbackService {


    @Override
    public void confirm(CorrelationData correlationData, boolean ack, String cause) {
        log.info("returnedMessage,correlationData:{},ack:{},cause:{},routingKey:{}", JSON.toJSONString(correlationData), ack, cause);
    }

    @Override
    public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
        log.info("returnedMessage,replyCode:{},replyText:{},exchange:{},routingKey:{}", replyCode, replyText, exchange, routingKey);
    }

}