Skip to main content

error serializing to sink topic

Hello kafka community,
I checked in debug that the serializer is KafkaAvroSerializer, like it
should be.
So in KStreamImpl.to(TopicNameExtractor<K, V> topicExtractor,
ProducedInternal<K, V> produced) I checked that the serializer is avro.

However here is the exception i receive:

"ClassCastException while producing data to a sink topic.

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:
com.ovoenergy.global.ContractKey / value type:
com.ovoenergy.global.ContractValue). 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))`)."

Thank you
--

Dumitru-Nicolae Marasoui

Software Engineer


140-142, Kensington Church Street, London, W8 4BN

w kaluza.com <https://www.kaluza.com/>

LinkedIn <https://www.linkedin.com/company/kaluza> | Twitter
<https://twitter.com/Kaluza_tech>

Kaluza Ltd. registered in England and Wales No. 08785057

VAT No. 100119879

Help save paper - do you need to print this email?

Comments