package com.ltgk.video.common;

import com.ltgk.common.utils.StringUtils;
import com.ltgk.video.service.IDsVideoService;
import lombok.extern.log4j.Log4j2;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @Author: wan kun
 * @Description: TODO
 * @Date: 2024/9/20 16:00
 * @Version: 1.0
 */
@Log4j2
@Component
@RocketMQMessageListener(topic = "${rocketmq.linkageProducer.topic}", consumerGroup = "${rocketmq.linkageProducer.group}")
public class PointRocketMQConsumer implements RocketMQListener<String> {
    @Autowired
    private IDsVideoService dsVideoService;
    @Override
    public void onMessage(String message) {
//        log.info("receive message:{}", message);
        if (StringUtils.isEmpty(message)) {
            return;
        }
        dsVideoService.servoByRadar(message);
    }
}
