Skip to content

Instantly share code, notes, and snippets.

@pavangadagi
Last active March 25, 2020 09:41
Show Gist options
  • Save pavangadagi/0add2aac50066d8b1eb9b1e94b9f64cf to your computer and use it in GitHub Desktop.
Save pavangadagi/0add2aac50066d8b1eb9b1e94b9f64cf to your computer and use it in GitHub Desktop.
Set<String> topicSet = new HashSet<String>(Arrays.asList(topics.split(",")));
JavaInputDStream<ConsumerRecord<String,JsonNode>> streams = KafkaUtils.createDirectStream(
streamingContext,
LocationStrategies.PreferConsistent(),
ConsumerStrategies.Subscribe(topicSet, kafkaParams));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment