Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when wrong annotation is used in wrong context (eg: @EventSourcingHandler) #75

Open
Blackdread opened this issue Apr 28, 2022 · 0 comments

Comments

@Blackdread
Copy link

Blackdread commented Apr 28, 2022

Feature Description

Error when wrong annotation is used in wrong context (eg: @EventSourcingHandler).
For example:

  • EventSourcingHandler should only be added to classes that are aggregates.
  • SagaEventHandler for sagas

This is extra: annotating same method with EventSourcingHandler, SagaEventHandler, CommandHandler does not give error.

Talked about it in AxonFramework/AxonFramework#1755

Current Behaviour

No errors or warnings.
For SagaEventHandler annotation, the plugin will consider the method as a potential receiver of the payload but it should not.

Wanted Behaviour

Show an error when annotation is not put on correct context (methods, etc).

Possible Workarounds

Extra

Most devs uses Intellij IDEA but would be great if could also work on a Maven plugin with java agent or other (maybe also gradle but I prefer maven).
And with a plugin, there could be checks done in CI, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants