package com.yeshi.buwan.util.mq.rabbit.consumer;
|
|
import com.rabbitmq.client.Channel;
|
import com.yeshi.buwan.util.mq.rabbit.RabbitmqMsgConsumeUtil;
|
import org.springframework.amqp.core.Message;
|
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
import org.springframework.stereotype.Component;
|
import org.yeshi.utils.StringUtil;
|
|
import javax.annotation.Resource;
|
import java.nio.charset.StandardCharsets;
|
|
/**
|
* @author hxh
|
* @title: QueueHelloWorldListener
|
* @description:
|
* @date 2024/9/26 13:47
|
*/
|
@Component
|
public class VideoSyncDataV2Listener {
|
|
@Resource
|
private RabbitTemplate rabbitTemplate;
|
|
public void onMessage(Message message, Channel channel) throws Exception {
|
RabbitmqMsgConsumeUtil.processMessage(message, channel, rabbitTemplate, () -> {
|
String result = new String(message.getBody(), StandardCharsets.UTF_8);
|
//TODO 处理消息
|
if(!StringUtil.isNullOrEmpty(result)) {
|
}
|
});
|
}
|
}
|