Previously we used a dedicated BeanPostProcessor to decorate beans that expose transactional event listeners with an interceptor to mark event publications as completed if the method invocation completes successfully. We now have simplified the arrangement by using Spring's auto-proxy creation and registering an Advisor implementation. This allows us to properly and reliably order the interceptor between the async one (goes before ours) and the transactional one (goes after ours). Also, this significantly simplifies the implementation of the interceptor as we can assume only commit listener methods being intercepted in the first place.
The tests previously asserted on no entries being found in the event publication tables. As other tests might have been run before, they could already contain some.
Avoid explicit MySQL database driver dependency to align with Boot. DatabaseSchemaInitializer is now fully immutable, receiving the ResourceLoader in its constructor.
Switch to consistent usage of secrets via environment variables. Remove documentation generation from standard build. Some general POM polishing. A bit of release documentation.
Turn embedded MongoDB test setup into proper bean definitions to make sure databases get started and shut down properly with ApplicationContexts. Previously, the database was held in a static variable shut down after a particular test class had been concluded but bean instances held in the cached (and potentially reused ApplicationContext) were still referring to that already shut down database which prevented then from shutting down properly.
A couple of renames in the exposed APIs. MapBasedEventPublicationRepository now uses a a TreeMap again instead of a List (closer to what the original EventPublicationRegistry did).
Cleanups in the JDBC event registry module. Polish pom.xml to minimize dependencies. Removed custom DatabaseType in favor of Boot's DatabaseDriver. Tweaked the auto-configuration of the JDBC module to not even expose a DatabaseSchemaInitializer in the first place to avoid having to wire the boolean flag into the latter.
Cleanups in test cases to avoid code duplication. Move to @JdbcTest to avoid having to depend on Spring Data JDBC.
Enable nullability checks, formatting, Javadoc, author tags, missing license headers.
- Introduce Repository interface as a customization point
- Get rid of Registry interface by having one generic implementation
- Combine EventPublication and all its subclasses in one domain object
- Make Repository instead of Registry be dependent on EventSerializer
Signed-off-by: Dmitry Belyaev <dbelyaev@vmware.com>