-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiling Avro as part of other build causes kafka (de)serialisation failures #31650
Comments
/cc @alesj (kafka), @cescoffier (kafka), @evanchooly (kotlin), @geoand (kotlin), @ozangunalp (kafka) |
I notice that this got labelled as Kotlin... yes, one of the stack traces was from a Kotlin service but we are also having the same issue with Java services so it doesn't appear that language is an important issue. |
I have the same issue. @briancullen did you find a solution? |
The second stack trace happens because producer and consumer apps can't discover that the payload type is an Avro generated type, and fallback to using an auto-generated json serde. That is because the shared-avro module doesn't include Jandex index: https://quarkus.io/guides/gradle-tooling#multi-module-gradle. The easiest way to fix this is to add an empty I can not reproduce the first stacktrace, I reckon this happens because of an incompatible confluent serde dependency. @joschne unless you still experience an issue I am going to close this one. Thanks! |
See last comment. |
Describe the bug
We are currently using quarkus
2.4.1.Final
for this project and are trying to upgrade to the latest version but we are having issues with the changes that have occurred with how AVRO is handled.We are using gradle with a number of subprojects. As these services defined by these subprojects tend to communicate over kafka we separated out the avro (along with some related Java classes) to it's own subproject which the consumers and producers then add as an implementation dependency. Unfortunately when we try this on newer version of quarkus, specifically those that print an error message requiring us to import the quarkus-confluent-registry-avro extension things break.This seems to be after Quarkus
2.8
Expected behavior
If the avro files have been compiled as part of a separate build that is included as an implementation dependency then you should be able to send and receive messages over kafka using these generated classes.
Actual behavior
The error we are encountering is different from the one I managed to create in a reproducer. My original error (and the one I can still get in the real repository) is as follows. Note I have changed the package of the Transaction event package.
The reproducer gives the error below and although it is different it is still related to the (de)serialisation process when the only difference seems to be the classes being compiled in a separate subproject.
How to Reproduce?
https://github.com/briancullen/quakus-avro-sample
Steps to Reproduce:
srcipts/run_consumer.sh
in one terminalscripts/emit_movies.sh
Output of
uname -a
orver
Linux host 5.19.0-35-generic #36~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Output of
java -version
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
Build tool (ie. output of
mvnw --version
orgradlew --version
)Additional information
No response
The text was updated successfully, but these errors were encountered: