Event handler ordering in Axon 2.1

Hi,

Am I correct in assuming that the new EventListener ordering only works for SimpleClusters? I’ve been browsing the source code and see that for example in AsynchronousClusters the EventListeners are scheduled in the preferred order but I’m assuming this does not mean they will be handled in this order.

Regards,

Dennis

Hi Dennis,

that’s not correct. It works on all clusters extending the AbstractCluster, which includes the async one. For performance reasons, the ordering is done on on registration of the listeners. the Set implementation chosen is an OrderedSet. When an event is handled, the listeners are invoked in the order provided by the set’s iterator.

Cheers,

Allard

Hi Allard,

Hi Dennis,

that depends on the cluster. The AsyncCluster can execute handlers in parallel, depending on the SequencingPolicy provided. If the policy allows concurrent execution, there are no guarantees.

Cheers,

Allard