package com.itheima.kafka.consumer.handler;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * Kafka消费者处理类
 */
@Component
public class KafkaConsumerHandler {

    // 定义日志记录器
    private static final Logger LOGGER = LoggerFactory.getLogger(KafkaConsumerHandler.class) ;

    @KafkaListener(topics = "itheima" , groupId = "itheima.demo")
    public void consumerHandler(String msg) {
        LOGGER.info("consumer topic is : {} , msg is ----> {} " , "itheima" , msg);
    }

}
