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的片段。