Have a scenario with an event with generic data;
EventHandler listener for lister1 listens for
and another event handler listener2 listens for
Event fired is only with a Aggregate which has in abstract class and the inherited class gets its own repository and data type e.g.
ConcreteAggregateForType1 extends AbstractAggregate< ConcreteDataType1> and ConCreteAggregateForType2 extends AbstractAggregate<ConcreteDateType2) and they apply the above events.
Axon is firing both Event handlers for AggregateEvent and throwing class cast exceptions… when is should be firing for the event with its corresponding data Type ConcreteDataType1 and neglecting the other handler. This is major issue for reuse in design, otherwise lot of cut and paste code for type specific transformations in the listeners with payload/pass through type data differing for aggregates inherited leveraging generics and common aggregate logic for types/flavors of similar aggregates.
Any thoughts… Cheers and Thanks