package com.friday.distributor.config;

import lombok.extern.slf4j.Slf4j;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.support.Acknowledgment;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
@Slf4j
public class ConsumerListener {


    @KafkaListener(topicPattern = "FRIDAY_OPERATION.*", containerFactory = "kafkaListenerContainerFactory")
    public void taskListener(List<ConsumerRecord<?, ?>> records, Acknowledgment ack) {
        log.info("kafka accepted hahaha");
        ack.acknowledge();
    }
}
