Created
January 30, 2017 05:37
-
-
Save isaacmg/7975f9be7ae6d8bf3a0c9538ce9764cb to your computer and use it in GitHub Desktop.
Kafka Json
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 characters
List<String> jsonString = getDataString(s); | |
KafkaProducer<String,String> producer = new KafkaProducer<String,String>(props); | |
for(String message:jsonString) | |
{ | |
ProducerRecord<String,String> producerRecord = new ProducerRecord<String,String>("test", "a river", message); | |
producer.send(producerRecord); | |
} | |
producer.close(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment