@@ -87,14 +87,14 @@ public class VideoService {
8787 public VideoService () {
8888 // Kafka Producer Configuration
8989 Properties producerProps = new Properties ();
90- producerProps .put (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , "localhost :9092" );
90+ producerProps .put (ProducerConfig .BOOTSTRAP_SERVERS_CONFIG , "192.168.120.131 :9092" );
9191 producerProps .put (ProducerConfig .KEY_SERIALIZER_CLASS_CONFIG , StringSerializer .class .getName ());
9292 producerProps .put (ProducerConfig .VALUE_SERIALIZER_CLASS_CONFIG , StringSerializer .class .getName ());
9393 this .kafkaProducer = new KafkaProducer <>(producerProps );
9494
9595 // Kafka Consumer Configuration
9696 Properties consumerProps = new Properties ();
97- consumerProps .put (ConsumerConfig .BOOTSTRAP_SERVERS_CONFIG , "localhost :9092" );
97+ consumerProps .put (ConsumerConfig .BOOTSTRAP_SERVERS_CONFIG , "192.168.120.131 :9092" );
9898 consumerProps .put (ConsumerConfig .GROUP_ID_CONFIG , "video-genres-group" );
9999 consumerProps .put (ConsumerConfig .KEY_DESERIALIZER_CLASS_CONFIG , StringDeserializer .class .getName ());
100100 consumerProps .put (ConsumerConfig .VALUE_DESERIALIZER_CLASS_CONFIG , StringDeserializer .class .getName ());
@@ -521,6 +521,10 @@ private void saveToDatabase(Recommender recommender) {
521521 public void uploadReport (String videoId , String msg , String userId ) {
522522 Report report = new Report (videoId , msg , userId );
523523 mongoTemplate .save (report );
524+ MDC .put ("type" , "videoservice" );
525+ MDC .put ("action" , "report" );
526+ MDC .put ("videoid" , videoId .toString ());
527+ logger .info ("User " + userId .toString () + " report " + msg );
524528 }
525529
526530 public List <String > getReportsWithHighFrequencyVideoIds () {
0 commit comments