Support for avro4s 2+
See original GitHub issueWe’ve updated avro4s to 2.0.2 as they’ve added support for deserialising instant values but this looks to have broken something.
[error] sbt.ForkMain$ForkError: java.lang.NoSuchMethodError: com.sksamuel.avro4s.ToRecord.apply(Ljava/lang/Object;)Lorg/apache/avro/generic/GenericRecord;
[error] at com.ovoenergy.kafka.serialization.avro4s.Avro4sSerialization$$anonfun$avroBinarySchemaIdSerializerWithProps$1.apply(Avro4sSerialization.scala:284)
[error] at com.ovoenergy.kafka.serialization.avro4s.Avro4sSerialization$$anonfun$avroBinarySchemaIdSerializerWithProps$1.apply(Avro4sSerialization.scala:283)
[error] at com.ovoenergy.kafka.serialization.core.Serialization$$anon$1.serialize(Serialization.scala:41)```
From what we could gather it looks like the apply in avro4s 2+ FromRecord and ToRecord expects extra parameters from the one in 1.9.1.
1.9.1
https://github.com/sksamuel/avro4s/blob/v1.9.1/avro4s-macros/src/main/scala/com/sksamuel/avro4s/ToRecord.scala#L204
v2.0.2
https://github.com/sksamuel/avro4s/blob/v2.0.2/avro4s-core/src/main/scala/com/sksamuel/avro4s/ToRecord.scala#L23
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
sksamuel/avro4s - Gitter
Can anybody help to understand how genTraitObjectEnum works. I need to generate schema and other typeclasses for sealed trait of objects and can...
Read more >Is there a way to support schema evolution in avro4s
No. Avro in general supports Schema Evolution when you provide it a schema, it can match against the name of the properties and...
Read more >com.sksamuel.avro4s.SchemaFor - javadoc.io
There must be a instance of this typeclass in scope for any type we want to support in avro4s. Users can add their...
Read more >com.sksamuel.avro4s : avro4s-json_2.12 : 4.0.2 - Maven Central
avro4s -json - avro4s-json. ... Source code, git@github.com:sksamuel/avro4s.git ... com.sksamuel.avro4s:avro4s-json_2.12 4.0.2. content_copy.
Read more >crealytics / avro4s Download - JitPack
1.6.4 - Added support for Vectors; 1.6.3 - Fixed issue with decimal schema using strings instead of ints for scale and precision; 1.6.2...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi, The work to support avro4s 2 is already in progress in one of the branch. Thanks for reporting. Will take a look at the specific issue you have raised
Fixed in https://github.com/ovotech/kafka-serialization/pull/56