axon

What is payloadRevision in axon server stored payload?


I'm playing around with axon server and have connected a dummy project to the server. While browsing the events on the server, I saw the field payloadRevision and couldn't find any information on what that meant?

My best guess is that would ordinarily store the the event version number, but I wasn't sure how to test this.

enter image description here


Solution

  • The payloadRevision field stores the "version" of the event that was stored in AxonServer. Clients can provide a version number to make the task of upcasting more efficient. This is the case when the structure of events changes over time.

    There is a chapter on Event Upcasting in the Axon Framework reference guide: https://docs.axoniq.io/reference-guide/axon-framework/events/event-versioning

    The default value of the revision is empty. Once the structure of an event changes, it is recommended to put a value in there, which the upcasters can recognize. The first upcaster would take the empty revision and convert the structure to whatever structure was next.