what is the prefered way of registering event upcasters in the event store provided by the Axon Connector? I couldn’t find anything about it in the docs.
Another question, just to make sure I get it right - if my aggregates and event listeners live in different deployments, I will need event upcasters on both sides, right?
if you’re on Spring Boot, you can just define your upcasters in your application context. Use Spring’s @Order to make sure they are put into a chain in the right order.
You can also use the AxonConfiguration API to register your upcasters. The Configurer exposes a method to register an upcaster. The chain is formed using these upcaster in the order in which they were registered.
Lastly, you can also configure the upcasters on the AxonServerEventStore instance itself, using the appropriate builder method: AxonServerEventStore.Builder#upcasterChain
Regarding your second question: yes, if you have an upcaster, it may be necessary to include that upcaster in your projection project as well. Upcasters transform data on the fly, while it’s being loaded. That means nothing in the Event Store is actually altered. If you don’t, and your processor is being reset or is still catching up with events, your projections will just see the originally stored data. Whether it is required to upcast that depends on the information the projection needs.