Git Product home page Git Product logo

Comments (4)

rayokota avatar rayokota commented on June 12, 2024 1

This is fixed by #2835

from schema-registry.

d3ns0n avatar d3ns0n commented on June 12, 2024

We experience a similar behaviour during serialization of kafka events with time related fields (java.time.*).
After setting the property spring.kafka.properties.avro.use.logical.type.converters=true serialization in 7.5.2 works again the same way as in 7.5.1. I also agree with @roookeee that this change is not acceptable in a patch version release

from schema-registry.

panphg avatar panphg commented on June 12, 2024

We experience a similar behavour with Quarkus (SmallRye Reactive Messaging) and logical types, e.g. java.time.Instant. Serialization with 7.5.2 works again if we set mp.messaging.outgoing.[channel].avro.use.logical.type.converters=true, but we have to do this for each channel separately.

It would be nice to know if this was an unintentional change that will be reverted (so we can just skip this version) or if this behaviour is here to stay.

from schema-registry.

loicgreffier avatar loicgreffier commented on June 12, 2024

Same behaviour here. After upgrading to io.confluent:kafka-avro-serializer:7.5.2 or io.confluent:kafka-streams-avro-serde:7.5.2 on java.time.Instant:

Caused by: org.apache.avro.AvroRuntimeException: Unknown datum type java.time.Instant: 2000-01-01T01:00:00Z
	at org.apache.avro.generic.GenericData.getSchemaName(GenericData.java:947)
	at org.apache.avro.specific.SpecificData.getSchemaName(SpecificData.java:440)
	at org.apache.avro.generic.GenericData.resolveUnion(GenericData.java:906)
	at org.apache.avro.generic.GenericDatumWriter.resolveUnion(GenericDatumWriter.java:307)
	at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:157)
	at org.apache.avro.specific.SpecificDatumWriter.writeField(SpecificDatumWriter.java:108)
	at org.apache.avro.generic.GenericDatumWriter.writeRecord(GenericDatumWriter.java:234)
	at org.apache.avro.specific.SpecificDatumWriter.writeRecord(SpecificDatumWriter.java:92)
	at org.apache.avro.generic.GenericDatumWriter.writeWithoutConversion(GenericDatumWriter.java:145)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:95)
	at org.apache.avro.generic.GenericDatumWriter.write(GenericDatumWriter.java:82)
	at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.writeDatum(AbstractKafkaAvroSerializer.java:192)
	at io.confluent.kafka.serializers.AbstractKafkaAvroSerializer.serializeImpl(AbstractKafkaAvroSerializer.java:162)

I am using the following dependencies directly:

<dependency>
    <groupId>io.confluent</groupId>
    <artifactId>kafka-streams-avro-serde</artifactId>
    <version>${kafka-streams-avro-serde.version}</version>
</dependency>

 <dependency>
    <groupId>io.confluent</groupId>
    <artifactId>kafka-avro-serializer</artifactId>
    <version>${kafka-avro-serializer.version}</version>
</dependency>

Here are code samples to reproduce: https://github.com/loicgreffier/spring-boot-kafka-quickstarts

  • See the opened PRs for the full stack traces for both dependencies
  • The behaviour can be reproduced by upgrading the dependencies to 7.5.2

from schema-registry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.