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

Spring Cloud Stream Integration #244

Closed
frne opened this issue Aug 6, 2024 · 3 comments
Closed

Spring Cloud Stream Integration #244

frne opened this issue Aug 6, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@frne
Copy link

frne commented Aug 6, 2024

Is your feature request related to a problem? Please describe.
Using Spring Cloud Stream with Kafka and Avro still relies on the old maven plugin, generating java classes from avro schemas. With gradle, it even needs a custom task implementation to generate java source from avro schemas.

Describe the solution you'd like
Would be nice, if this library was usable with Spring Cloud Stream (and Confluent Schema Registry). Mabe this is even possible and it just needs documentation...

Describe alternatives you've considered
Alternative is using the old generated java classes.

Additional context

@frne frne added the enhancement New feature or request label Aug 6, 2024
@Chuckame
Copy link
Contributor

Chuckame commented Aug 7, 2024

I'm a bit lost. You are expecting avro4k to be working with spring cloud stream, but also supporting the confluent SR and also generate classes, please check first the existing issues, then open the according issues for each specific demand or open a discussion. Avro4k is intended to be as generic as possible, the reason why we don't bundle such specific serializer. However, there are some common usage, by example serializing avro in kafka events using the confluent schema registry. Those common usage may lead to adding other packages (follow this for kafka + SR #218).

There is no blocker about using this library in any framework, but for sure it needs adaptation to fit the framework. For serializing specific avro content in spring cloud stream (but without confluent SR), you should create your (de)serializer which would use Avro.encodeToByteArray or Avro.decodeToByteArray. Then you just need to configure your binder using this serializer.

Also, you are talking about generated java source while this library is for kotlin sources. Let's suppose you want kotlin source generation, then please check #212

Still, thanks for the interest for this library, and don't hesitate to a PR to add a guide on how to use it in spring cloud stream 🚀

@frne
Copy link
Author

frne commented Aug 8, 2024

I'm aware that this is of course a Kotlin library that shouldn't generate Java classes. Mentioned for context only, that many avro implementations still rely on that.

Spring Cloud Stream, like some other Frameworks, relies on io.confluent.kafka.serializers.KafkaAvroSerializer and I was curious if there's any easy integration or plans to provide one.

More broadly, the request / question was if you plan to actively provide framework integration (e.g. with Spring Cloud Stream), which has been answered. Closing the issue therefore, thanks for the explanations.

@frne frne closed this as completed Aug 8, 2024
@Chuckame
Copy link
Contributor

Chuckame commented Aug 8, 2024

I'll still repeat a detail, we are planning to support code generation and confluent/kafka serializers, which would allows you to be used with spring cloud stream! 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants