Good morning.
I'm working on a spring boot projet with kafka integration already implemented (a kafka message producer). The kafka configuration is done in application.properties as followed:
spring.kafka.bootstrap-servers=
spring.kafka.properties.sasl.jaas.config=
spring.kafka.properties.security.protocol=
spring.kafka.properties.sasl.mechanism=
spring.kafka.producer.key-serializer=
spring.kafka.producer.value-serializer=
spring.kafka.producer.acks=
Now we are introducing the AsyncAPI to better describe and document our event-driven architecture.
I'm wondering how I can import the asyncApi.yaml(containing the Kafka description) file in my java code.
Please can you advise me how asyncApi.yaml file can be used to implement a kafka producer. Is it possible to generate pojo classes using the asyncApi.yaml ?
I'm using Springboot and maven and i'm not find a proper way to integrate the asyncApi.yaml in the project
thanks a lot.
There is a library that understands AsyncAPI, extracts schemas from it and can generate models in different languages, Java included -> https://github.com/asyncapi/modelina
It is integrated in AsyncAPI CLI that you can use to generate these models, like
asyncapi generate models java asyncapi.yml-> https://github.com/asyncapi/cli/blob/master/docs/usage.md#asyncapi-generate-models-language-fileAsyncAPI CLI is not only shipped as NPM package, but also a binary that you could invoke in Maven. Sorry but I do not have an example Maven config that I could share with you. But yeah, you have many different options, like just docker -> https://www.asyncapi.com/docs/tools/cli/installation