Skip to content
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

Don't autodetect Avro serde in case multiple Avro serdes are present on classpath #21782

Closed
Ladicek opened this issue Nov 29, 2021 · 3 comments · Fixed by #24345
Closed

Don't autodetect Avro serde in case multiple Avro serdes are present on classpath #21782

Ladicek opened this issue Nov 29, 2021 · 3 comments · Fixed by #24345
Assignees
Milestone

Comments

@Ladicek
Copy link
Contributor

Ladicek commented Nov 29, 2021

Describe the bug

The SmallRye Reactive Messaging Kafka support for autodetection behaves weirdly in case multiple Avro serdes are present on classpath. The autodetection algorithm will just pick one of those serdes in an opaque way. It really should either avoid autodetection entirely, so that the application fails with missing configuration during startup, or even fail the build entirely.

Expected behavior

Predictable serde autodetection outcome in case multiple serdes are present.

Actual behavior

Seemingly random serde autodetection outcome in case multiple serdes are present.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@Ladicek Ladicek self-assigned this Nov 29, 2021
@Ladicek
Copy link
Contributor Author

Ladicek commented Mar 15, 2022

Apparently there are elaborate use cases that involve having multiple Kafka serdes on the classpath, so failing the build is not an option. We simply should skip autodetection and let users configure Kafka serde manually.

@knutwannheden
Copy link
Contributor

knutwannheden commented Mar 16, 2022

For the Avro use case, where most channels will be using the generic Avro serializer (specific to the schema registry implementation), I think that it would be useful with an explicit config property like quarkus.reactive-messaging.kafka.schema-registry.compatibility-mode (which can be set to auto (default), confluent, apicurio1, or apicurio2). This would allow the extension to correctly set the Avro-specific config for the channels.

With this approach the extension could fail the build when the property is set to auto and it detects multiple Avro serdes and instruct the user to set this config property to a value other than auto.

@Ladicek What do you think about this proposal?

@Ladicek
Copy link
Contributor Author

Ladicek commented Mar 16, 2022

I still don't want configuration for autodetection. It's a slippery slope and we'll eventually end up creating an alternative configuration system for SmallRye Reactive Messaging. Autodetection should work well for the most common 80% of cases, and if you need something advanced, you should just configure SmallRye Reactive Messaging directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants