Prioritizing handling of messages

Hi,

I have the following situation:

  • Data arrives in a stream and each chunk of data results in a command for Aggregate A or B.
  • They both create an Event, also of type A or B.
  • The events are picked up by seperate Saga’s for either A or B.
  • Each saga will issue a command. Command A and B end up the same processing group.
  • The processing group has a tracking event processor with 10 segments.

I need to prioritize in such a way that if there are commands of type A, they are processed first and all commands of type B are processed iff there are no commands of type A to process.

This seems promising:
https://apidocs.axoniq.io/4.5/org/axonframework/config/EventProcessingConfigurer.html#assignHandlerTypesMatching-java.lang.String-int-java.util.function.Predicate-

But I have no idea how to use it and if it is even relevant. No examples or mentions in the docs.