Skip to content

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

@Blackdread

Description

@Blackdread

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions