1

I'm using SmallRye Reactive Messaging with Kafka with the Confluent Registry and AVRO. It works fine as explained in this blog https://quarkus.io/blog/kafka-avro/ But it seems not work in native compilation in the source code associated to the blog: https://github.com/cescoffier/quarkus-kafka-and-avro

I have the same problem with my environment (Avro 1.10.0 and Confluent Registry) You will see the logs at the end of this message.

Is it planned to work on the native support? Or may be an issue must be opened?

Remark: quarkus avro extension with Kafka Streams + Avro + Confluent Registry works fine in native.

Thanks.

[kafka-and-avro-1.0.0-SNAPSHOT-runner:96219] analysis: 28 016,32 ms, 2,72 GB Error: Classes that should be initialized at run time got initialized during image building: me.escoffier.quarkus.Movie the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis). To see why me.escoffier.quarkus.Movie got initialized use -H:+TraceClassInitialization org.apache.avro.generic.GenericDatumReader the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis). To see why org.apache.avro.generic.GenericDatumReader got initialized use -H:+TraceClassInitialization

com.oracle.svm.core.util.UserError$UserException: Classes that should be initialized at run time got initialized during image building: me.escoffier.quarkus.Movie the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis). To see why me.escoffier.quarkus.Movie got initialized use -H:+TraceClassInitialization org.apache.avro.generic.GenericDatumReader the class was requested to be initialized at run time (from feature io.quarkus.runner.AutoFeature.beforeAnalysis). To see why org.apache.avro.generic.GenericDatumReader got initialized use -H:+TraceClassInitialization

Daveva
  • 21
  • 2

1 Answers1

0

The problem is that to use avro in native you have to indicate to graalvm the classes that it has to do native.

To use quarkus with avro in native mode you need to declare all avro objects in file reflection-config.json

I have an example on github

Xabe
  • 1
  • 2
  • Instead of relying primarily on a link to demonstrate how to solve this, please provide the relevant examples in your Stack Overflow answer. It's fine to include a link for more information, but your answer should be self-contained and easily understood without it. – Jeremy Caney Nov 30 '21 at 00:19
  • While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/30464416) – aerial Dec 01 '21 at 07:21