I have encountered the @DomainEvents and @AfterDomainEventsPublication annotation in spring Data JPA Reference Documentation. But I am not able to find the perfect example to explain about these annotaions
You can see sample in the original unit tests for EventPublishingRepositoryProxyPostProcessor
EventPublishingRepositoryProxyPostProcessorUnitTests.java by Oliver Gierke in GitHub Repository of Spring Data Commons.
Description in base issue of Spring Jira DATACMNS-928 Support for exposing domain events from aggregate roots as Spring application events was useful for me.
UPDATE
This is simple and really working example by Zoltan Altfatter: Publishing domain events from aggregate roots
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With