Open
Description
A DomainEvent is emitted again when calling save or delete on the emitting Entity in the EventListener.
there is an Entity
- implementing AbstractAggregateRoot
- with a method registering a DomainEvent
a Service
- is calling the method registering a DomainEvent
- saving the Entity with the repository
in a @eventlistener method - the entity is taken from the event or looked up via repository
- the entity is saved or deleted via the repository
- the DomainEvent is emitted again
an infinite loop is starting
If save or delete is called more then one time the event is emitted only once.
There is a demo attached showing the behavior.
demo-reemit-event-in-listener.zip