My Aggregate receives messages from an integration service that deals with some external system. Semantically, these messages are events: they tell the aggregate of what has already happened. I classify them as “external events”.
However, they are targeted at that specific aggregate instance and in that are similar to commands.
The only way I’ve found to have the aggregate process them is by using @CommandHandler annotation. But this just looks wrong because these messages are events.
What does it take to create a custom annotation, e.g. @ExternalEventHandler, that behaves like @CommandHandler?
I apologize in advance if this question has been asked/answered here before: I looked for, and haven’t found the answer.
Thank you very much!