1
在卡夫卡流,什麼是目的:在卡夫卡流,這是什麼VALUE_SERDE_CLASS_CONFIG做
props.put(StreamsConfig.KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
props.put(StreamsConfig.VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
...考慮到SERDES可以在builder
叫了一聲:
final KStream<String, String> textLines = builder.stream(stringSerde, stringSerde, "TextLinesTopic");
...在to
:
wordCounts.to(stringSerde, longSerde, "WordsWithCountsTopic");
在我的代碼我刪除了上述兩個props.put
電話和一切似乎仍然正常工作。另請注意,即使在調用to
時使用了Serdes.Long(),也不會將其傳遞給VALUE_SERDE_CLASS_CONFIG。
摘自confluent sample的片段。