gpt4 book ai didi

java - Kafka DSL Kstream-> Ktable Join-连接的序列化编译错误

转载 作者:行者123 更新时间:2023-12-03 07:38:57 26 4
gpt4 key购买 nike

我正在尝试根据此kafka documentation实现此连接。
我不知道为什么这个连接不起作用...
first try
首先,我通过了所有值(value)观。
without parameter
在这里,它试图强制泛型为对象类型,这是非常错误的。
如果不使用序列化选项加入,我会收到以下运行时异常:

Exception in thread "StreamAPP-stream-event-b3dc5fff-abee-4fa0-92f9-e1690f8fd152-StreamThread-1" org.apache.kafka.streams.errors.StreamsException: ClassCastException while producing data to topic StreamAPP-stream-event-KSTREAM-KEY-SELECT-0000000025-repartition. A serializer (key: org.apache.kafka.common.serialization.ByteArraySerializer / value: org.apache.kafka.common.serialization.ByteArraySerializer) is not compatible to the actual key or value type (key type: br.com.calebebrim.kafka.entities.stream.sharing.registry.StreamRegistryKey / value type: br.com.calebebrim.kafka.entities.stream.sharing.stream.Event). Change the default Serdes in StreamConfig or provide correct Serdes via method parameters (for example if using the DSL, #to(String topic, Produced<K, V> produced) with Produced.keySerde(WindowedSerdes.timeWindowedSerdeFrom(String.class)))


谁能帮我?
谢谢!

最佳答案

解决了,
我发现联接操作无法转换数据。
所以,我只是在像这样之前应用了mapValues:
stream map values before join

关于java - Kafka DSL Kstream-> Ktable Join-连接的序列化编译错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65618953/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com