apache-kafka-streams - nullpointer exception in aggregate operation in kafka stream
问题描述
below is code snippet,
streamsConfiguration.put(StreamsConfig.APPLICATION_ID_CONFIG, "wordcount-live-test");
streamsConfiguration.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, "brokerIP:port");
streamsConfiguration.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
streamsConfiguration.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.String().getClass().getName());
streamsConfiguration.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE);
StreamBuilder builder = new StreamBuilder();
KStream streamData = builder.stream(inputTopicName);
streamData.groupByKey(Grouped.with(jsonSerde,jsonSerde))
.aggregate( //some transformation );
KafkaStreams kafkaStreams = new KafkaStreams(
builder.build(streamConfiguration),
streamConfiguration
);
here we are not using session window and this snippet gives me perfect result. But when I introduce session window with this stream then it gives null
pointer exception for aggregate function.
can anybody help here
解决方案
推荐阅读
- c - 在 c 中通过带有 strcpy 的函数初始化结构
- php - 我如何让代码相信我试图从 MySQL 数据库中提取的数据确实存在?
- go - 股票仍然活在记忆中
- spring-boot - 如何删除通过测试创建的电子表格?
- electron - 找不到模块'调试
- android - 如何使用 LiveData 每秒进行一次改造电话?
- javascript - 如何有效地实例化 Vue 组件中的对象?
- unity3d - 从单色纹理生成网格
- android - 如何为每个按钮实施奖励视频广告
- ruby-on-rails - 在 Rails 中,# frozen_string_literal: true 指令与 StripParams 冲突