Created
August 1, 2020 17:38
-
-
Save pradeekpmohandas/13f44af3930ab37f781595402c71be11 to your computer and use it in GitHub Desktop.
Revisions
-
pradeekpmohandas created this gist
Aug 1, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ @Configuration public class Producer { @Autowired private KafkaTemplate<String, Student> kafkaTemplate; public String pushIntoKafka(String topic, Student student) { try { kafkaTemplate.send(topic, student); return "success"; } catch (Exception e) { return "failed"; } } }