skip to Main Content

Maybe someone already asked this question but after some searches I still don’t find an answer.

I have multiple Spring Boot applications which should communicate to each other via events streaming and REST calls. To enforce DTOs consistency I would like to use Apache Avro to generate Java classes but I don’t know where to store Avro schemas.

Say App1 should call App2, so App2 generates DTOs schemas that App1 will use to consume its data. Where can I store App1’s schemas so that App2 can take them to generate Java classes needed.

On the same way, App1 publishes messages on Redis and other applications that read those messages need to deserialize to Java object using Avro schemas, it would be very usefull if I could centralized those schemas somewhere.

I use Maven and Avro maven plugin.

Thanks a lot for your help.

2

Answers


  1. Chosen as BEST ANSWER

    I found a solution with this Spring Cloud project https://github.com/spring-cloud/spring-cloud-schema-registry It provides excatly what I need.


  2. You can create a APP_commons service which will cater to the avro schemas, which will contain the respective methods to generate the values/data that each APP needs.

    APP_commons can be added as a dependency in the pom of APP1 and APP2.

    Hope this helps! Also you can use feign clients.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search