AxonFramework / AxonFramework

Framework for Evolutionary Message-Driven Microservices on the JVM
https://axoniq.io/
Apache License 2.0
3.32k stars 790 forks source link

Investigate Message Schema Support #3106

Open smcvb opened 2 months ago

smcvb commented 2 months ago

Having some form of explicit message schema support would be a nice addition to Axon Framework. Whether this would be Protobuf, Avro, JSON schema, Thrift, or other tools we can think of, is not important for the core of Axon Framework, as we do not intend to become a schema registry.

What is important, is that we investigate if we need to adjust our APIs to be able to integrate any of these. Through, for example, an Axon Framework Extension repository.

Hence, this issue is intentionally left somewhat unclear, as I don't have an idea how to implement this yet.

gklijs commented 2 months ago

Typically you need some kind of id to make sure the same schema is used when reading the data, as was used for writing the data. I would think the meta data would allow for this. I can imagine for converters we need to take this usecase into account. So allow a converter to have access to the metadata for the conversion. Another thing is that the calls to get a schema are often relatively expensive. So allowing for some state in a converter would be nice to have a local schema cache, but that's also already there.