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

Introduce a `QualifiedName` instead of using the FQCN #3085

Open smcvb opened 2 months ago

smcvb commented 2 months ago

Description

Instead of using the fully qualified class names as payload types for the messages, we could (for example) use a combination of context, aggregate type (if applicable), and simple name, as the default. On top of that, it should become easier for users to define their own names for messages instead of relying on Axon Framework's default approach. This last pointer essentially mirrors the request made in #722.

Either way, not relying on the FQCN can have many benefits:

During the POC phase of Axon Framework, we played around with the concept of the so-called QualifiedName to be the replacement for using Class<?> payloadType throughout.

Examples: io.axoniq.hotel.api.booking.AddRoomToInventoryEvent- > booking.Room.AddRoomToInventoryEvent io.axoniq.hotel.api.inventory.AddRoomToInventoryEvent- > inventory.Room.AddRoomToInventoryEvent

When picking up this issue, be sure to check for any pending TODOs referring to the issue number of this issue.