package com.bootdo.datasend.dianxin.listener;

import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class MessageConsumer {

    private static final Logger logger = LoggerFactory.getLogger(MessageConsumer.class);

    //测试消费kafka
    // 监听队列 "warnrecord"
//    @RabbitListener(queues = "warnrecord")
    public void receiveMessage(String message) {
        try {
            // 处理接收到的消息
            logger.info("Received message: " + message);
            // 在这里添加你对消息的处理逻辑
        } catch (Exception e) {
            // 捕获并打印异常
            e.printStackTrace();
        }
    }
}
