Apache kafka 参数不匹配;org.joda.time.Instant无法转换为org.apache.beam.sdk.transforms.SerializableFunction<;T、 org.joda.time.Instant>;
我试图在创建管道时将窗口应用于一个无界数据集,而我对ApacheKafka是新手,所以我尝试了各种“即时”方法,但都不管用!下面是代码片段Apache kafka 参数不匹配;org.joda.time.Instant无法转换为org.apache.beam.sdk.transforms.SerializableFunction<;T、 org.joda.time.Instant>;,apache-kafka,apache-beam,Apache Kafka,Apache Beam,我试图在创建管道时将窗口应用于一个无界数据集,而我对ApacheKafka是新手,所以我尝试了各种“即时”方法,但都不管用!下面是代码片段 pipeline .apply( KafkaIO.<Long, String>read() .withBootstrapServers(bootstrapServers) .withTopic(input
pipeline
.apply(
KafkaIO.<Long, String>read()
.withBootstrapServers(bootstrapServers)
.withTopic(inputTopic)
.withKeyDeserializer(LongDeserializer.class)
.withValueDeserializer(StringDeserializer.class)
.withoutMetadata()
)
.apply(Values.<String>create())
.apply("append event time", WithTimestamps.of(...)
.apply("extract message string", MapElements
.into(TypeDescriptors.strings())
.via(Record::getMessage))
.apply("apply window", Window
.<String>into(FixedWindows.of(Duration.standardMinutes(5)))
.withAllowedLateness(Duration.standardMinutes(5))
.triggering(AfterWatermark.pastEndOfWindow())
.accumulatingFiredPanes()
));
管道
.申请(
卡夫卡约
.使用BootStrapServer(BootStrapServer)
.withTopic(输入主题)
.withKeyDeserializer(LongDeserializer.class)
.withValueDeserializer(StringDeserializer.class)
.without元数据()
)
.apply(value.create())
.apply(“追加事件时间”,带有时间戳.)
.apply(“提取消息字符串”,MapElements)
.into(typedescriptor.strings())
.via(记录::getMessage))
.apply(“应用窗口”,窗口
.into(固定窗口的持续时间标准分钟数(5)))
.允许迟到(持续时间.标准分钟(5))
.triggering(AfterWatermark.pastEndOfWindow())
.累积燃烧烷()
));
我不知道里面有什么时间戳。当然(??),如果有人能帮我,我将不胜感激,谢谢