Search code examples
serializationdeserializationavroavro-tools

Other places to store Apache Avro schemas than the classpath


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.


Solution

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