core-java
core-java copied to clipboard
Reconsider message filtering by the Bus
Currently, the Bus filters are applied as follows:
-
ValidatingFilter
; -
DeadMessageFilter
; - custom filters (including
CommandScheduler
).
This creates an odd behavior where a dead or invalid message can’t be processed by a custom filter in any way, although it may be required for logging or similar purposes.
This already creates an issue for a dead Event
which is filtered out by the DeadMessageFilter
but still gets stored.
Simply moving the custom filters to be executed after the ValidatingFilter
and prior to the DeadMessageFilter
seemed like a proper solution at first, but then the issue is the CommandScheduler
being executed prior to the DeadMessageFilter
.
This ambiguity suggests that we need to reconsider how the message filtering is performed, and how default filters are applied.