-
Notifications
You must be signed in to change notification settings - Fork 155
@DomainEvent
detection does not work with inheritance
#1118
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
Comments
I also encountered a similar problem with the interface DomainEventHandler<EventT : DomainEvent, ReturnT : Any> : Ordered {
// ...
@DomainEventHandler
fun handle(event: DomainEvent): ReturnT
// ...
} interface BaseDomainEventHandler<EventT : DomainEvent> : DomainEventHandler<EventT, Mono<Unit>> {
override fun handle(event: DomainEvent): Mono<Unit> {
// ...
// some custom logic that calls doHandle
}
fun doHandle(event: EventT): Mono<Unit>
} @Component
internal class DoSomethingOnPaymentCompletedEvent(
// ...
) : BaseDomainEventHandler<PaymentCompletedEvent> {
override fun doHandle(event: PaymentCompletedEvent): Mono<Unit> {
// ...
}
} The |
And also a similar problem with the @NamedInterface("module-api")
annotation class ModuleApi When I annotate a class with |
@odrotbohm could you please assist me in understanding whether this is the expected behavior or not? |
For the jMolecules annotations, it's both. Unexpected from a developer's point of view, but expected from the annotation definition's perspective, as they are currently not declared as For |
Hello. I use a custom domain event system in my service, and all domain events share the same root interface. I have annotated this interface with the
org.jmolecules.event.annotation.DomainEvent
annotation:I then have a more specific interface for a subtype of my domain events:
And a concrete event implementation:
However, the
ApplicationModule#publishedEvents
remains empty. When I add the@DomainEvent
annotation directly toPaymentCompletedEvent
, it works.The text was updated successfully, but these errors were encountered: