我有以下
//Config setup
Properties props = ...; //setup
List<String> topicList = Arrays.asList({"A", "B", "C"});
StreamBuilder builder = new StreamBuilder();
KStream<String, String> source = builder.stream(topicList);
source
.map((k,v) -> {
//How can i get the topic of the record here
})
.to((k,v,r) -> {//busy code for topic routing});
new KafkaStream(builder.build(), properties).start();
德玛西亚99
慕哥6287543
随时随地看视频慕课网APP
相关分类