package com.tanpu.community.manager;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class KafkaManager {

    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

//    public void sendMessage(String message) {
//        System.out.println("#### send " + message);
//        this.kafkaTemplate.send("users", message);
//    }



    // todo topic
    @KafkaListener(topics = "newCommunityVisitor")
    public void consumeVisitorHis(String message) {
        System.out.println("#### receive " + message);
    }
}