search-service/src/main/java/com/stackroute/pie/listener/KafkaConsumer.java
//consuming data from kafka & setting it to commonauth
consuming data from kafka & setting it to commonauth
consuming data from kafka & setting it to commonauth
@KafkaListener(topics = "policy_added", groupId = "group_json", containerFactory = "userKafkaListenerFactory")
        public void consumeJson(Policy policy) {
            System.out.println("yoyoyoyoyo");
            System.out.println("Consumed JSON Message: " + policy);
            searchRepository.save(policy);
            System.out.println("Saved Policy" +policy.getPolicyId());
        }
@ KafkaListener ( topics = "policy_added" , groupId = "group_json" , containerFactory = "userKafkaListenerFactory" ) public void consumeJson ( Policy policy ) { System . out . println ( "yoyoyoyoyo" ) ; System . out . println ( "Consumed JSON Message: " + policy ) ; searchRepository . save ( policy ) ; System . out . println ( "Saved Policy" + policy . getPolicyId ( ) ) ; }
consuming data from kafka & setting it to commonauth
consuming data from kafka & setting it to commonauth