Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring boot Kafka流处理中的延迟_Spring Boot_Apache Kafka_Apache Kafka Streams - Fatal编程技术网

Spring boot Kafka流处理中的延迟

Spring boot Kafka流处理中的延迟,spring-boot,apache-kafka,apache-kafka-streams,Spring Boot,Apache Kafka,Apache Kafka Streams,我已经创建了一个Kafka流拓扑,我有1个源和2个汇 我将SpringBoot(2.1.9)用于Kafka流,而不是SpringCloud。卡夫卡版本2.3.0 @配置 @使能卡夫卡团队 公共类StreamStart{ @豆子 公共KStream流程(StreamsBuilder builder){ KStream inputStream=builder.stream(“streamIn”,consumered.with(Serdes.String(),Serdes.String()); KSt

我已经创建了一个Kafka流拓扑,我有1个源和2个汇

我将SpringBoot(2.1.9)用于Kafka流,而不是SpringCloud。卡夫卡版本2.3.0

@配置
@使能卡夫卡团队
公共类StreamStart{
@豆子
公共KStream流程(StreamsBuilder builder){
KStream inputStream=builder.stream(“streamIn”,consumered.with(Serdes.String(),Serdes.String());
KStream upperCaseStream=inputStream.mapValues(value->value.toUpperCase());
upperCaseStream.to(“outTopic”,producted.with(Serdes.String(),Serdes.String());
KTable wordCounts=upperCaseStream
.flatMapValues(v->array.asList(v.split(“”))
.选择键((k,v)->v)
.groupByKey(序列化的.with(Serdes.String(),Serdes.String()))
.count(具体化为.as(“计数存储”));
toStream().to(“wordCountTopic”,产生于.with(Serdes.String(),Serdes.Long());
返回上游;
}
}
数据在outTopic中即时流动,而在wordCountTopic中显示的数据每记录需要20-25秒


有什么建议吗?

请写下您使用的卡夫卡流设置默认值,您需要的任何特定设置??我认为大部分时间都在序列化它。尝试通过
物化.as(…).withCachingDisabled()禁用缓存。
。有关更多详细信息,请参阅有关缓存的文档。@MatthiasJ.Sax您是正确的,切中要害。我将阅读有关缓存的内容,但只是将其禁用,结果是即时的。但在幕后发生的是我需要知道。有没有任何关于卡夫卡流的书我可以读到,为什么没有人在演示合流,春季开发者会议中提到!!!“卡夫卡流在行动”可能是一个良好的开端