AxonFramework / extension-kafka

Axon Framework extension for Kafka integration to publish and handle Event messages.
https://axoniq.io/
Apache License 2.0
67 stars 28 forks source link

Support Event Upcasters during reading of events #193

Closed zambrovski closed 3 years ago

zambrovski commented 3 years ago

Enhancement Description

If the changes of the event classes are introduced the Kafka extension will try to deserialize the events using current class structure without the ability to match the binary representation of the event to the new structure. This will lead to a permanent fail of the Kafka consumer, since the structural change can't be adopted.

In case of Aggregate, Axon Framework provides a way of dealing with event evolution by using the Upcasters.

Current Behaviour

Currently, the events are de-serialized using the provided serializer without the ability to apply the upcaster (chain) to it.

Wanted Behaviour

The builder should accept the upcaster chain to pass the domain events through it.

Possible Workarounds

Replacement of the DefaultKafkaMessageConverterby an own one that support upcasters.

zambrovski commented 3 years ago

Discussed on forum by @abuijze https://discuss.axoniq.io/t/kafka-and-upcasting/1695/2