| | |
| | | package cc.mrbird.febs.rabbit.producer; |
| | | |
| | | import cc.mrbird.febs.rabbit.QueueEnum; |
| | | import cc.mrbird.febs.rabbit.RabbitMqConfig; |
| | | import cn.hutool.core.util.IdUtil; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | import org.springframework.amqp.rabbit.core.RabbitTemplate; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.UUID; |
| | | |
| | | /** |
| | | * @author wzy |
| | |
| | | rabbitTemplate.setConfirmCallback(this); |
| | | } |
| | | |
| | | public void sendOnHookEnd(Long orderId) { |
| | | log.info("发送用户结束挂机的消息:{}", orderId); |
| | | CorrelationData correlationData = new CorrelationData(UUID.randomUUID().toString()); |
| | | rabbitTemplate.convertAndSend(RabbitMqConfig.END_ON_HOOK_EXCHANGE, RabbitMqConfig.END_ON_HOOK_ROUTE_KEY, orderId, correlationData); |
| | | } |
| | | |
| | | public void sendMsg(String content) { |
| | | CorrelationData correlationData = new CorrelationData(IdUtil.simpleUUID()); |
| | | rabbitTemplate.convertAndSend(RabbitMqConfig.EXCHANGE_USDT_UPDATE, RabbitMqConfig.ROUTING_KEY_USDT_UPDATE, content, correlationData); |