Hello and welcome to AxonIQ community @parcival,
I recently found somewhat similar issue with command handlers which resulted in this issue:
No error/warning for duplicate command handler · Issue #1756 · AxonFramework/AxonFramework · GitHub.
I believe it’ll be OK to open similar issue for the case you’ve found. I can’t make any promises about the resolution and the timeframe but I agree with you - it would be nice to inform the user about the situation. I would argue that a warning message is more suitable in this case. Preventing the application from starting seems too restrictive to me.
That said and taking into account @allardbz’s comment about scatter-gather queries:
We might want to reconsider the behavior in that case
it may not be as straightforward as it seems. If we are to allow “duplicate” query handlers for scatter-gather queries (which I personally think is a good feature) than I guess we’ll have to allow them in general. AFAIK it’ll be next to impossible to know (at the time when query handling components are registered) how a particular query handling method will be used. That would probably render the warning we discus here useless. It would also require some other means (for example adding
priority attribute to
@QueryHandler) do decide which of the “duplicate” query handlers to execute for direct and subscription queries.
Perhaps @Steven_van_Beelen can tell which approach makes more sense and/or is better aligned with framework’s roadmap.