package com.xcong.excoin.rabbit.producer;
|
|
import cn.hutool.core.util.IdUtil;
|
import com.xcong.excoin.configurations.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;
|
|
@Slf4j
|
@Component
|
public class YunDingProducter implements RabbitTemplate.ConfirmCallback {
|
@Override
|
public void confirm(CorrelationData correlationData, boolean b, String s) {
|
|
}
|
|
private RabbitTemplate rabbitTemplate;
|
|
@Autowired
|
public YunDingProducter(RabbitTemplate rabbitTemplate) {
|
this.rabbitTemplate = rabbitTemplate;
|
rabbitTemplate.setConfirmCallback(this);
|
}
|
|
public void sendYunDingUsdtProfit(Long id) {
|
CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID());
|
rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_XCH, RabbitMqConfig.ROUTING_KEE_XCH_USDT_PRIFIT, id.toString(), correlationData);
|
}
|
}
|