Commit Graph

112 Commits

Author SHA1 Message Date
Oliver Drotbohm
ffb9495e15 GH-301 - Polishing.
Formatting, visibility. Some refactorings in Neo4jEventPublicationRepository.
2023-09-20 23:06:38 +02:00
Gerrit Meier
4e069b98ea GH-301 - Add Neo4j event publication repository. 2023-09-20 15:17:40 +02:00
Oliver Drotbohm
bf404a571c GH-248 - Add package-info.java for event externalization modules. 2023-09-19 11:04:47 +02:00
Oliver Drotbohm
9a25271946 GH-248 - Polishing.
Minor code cleanup.
2023-09-07 16:29:12 +02:00
Oliver Drotbohm
9b0062f354 GH-248 - Support to automatically externalize events.
We now allow externalizing application events to a variety of message brokers through the addition of Spring Modulith modules for Kafka, AMQP and JMS to a user project's classpath. Which events shall be externalized and how they're supposed to be routed to the message broker can be configured through either annotations or via a configuration API declared as Spring bean.

In case Jackson is on the classpath, we also add auto-configuration to use a Boot-configured ObjectMapper instance with the corresponding message broker client APIs to properly serialize and deserialize messages to JSON.
2023-09-07 16:29:10 +02:00
Oliver Drotbohm
971a143436 GH-294 - Introduce user API to deal with completed and incomplete event publications.
Introduce a new spring-modulith-events-api artifact to contain types that are supposed to be used by application code to deal with event publications. `EventPublication` was moved into that artifact and got everything non infrastructure related extracted from it's previous incarnation. That in turn has been renamed to `TargetEventPublication`.

`CompletedEventPublications` exposes API to allow purging completed publications either by a given predicate or age (in `Duration`). The interface is implemented by `DefaultEventPublicationRegistry` and thus subject for dependency injection into user code. It primarily delegates to the corresponding methods on `EventPublicationRepository` adapting the given `Duration`s to the `Clock` instance already held internally.

`IncompleteEventPublications` allows triggering the re-submission of incomplete publications by the same criteria as `CEP`. The interface is implemented by `PersistentApplicationEventMulticaster` and this subject for dependency injection into user code.

`EventPublicationRepository` now also allows publications to be deleted by identifiers. The existing implementations have been adapted and batch the requests for every 100 identifiers to prevent a list too large to run into limitations of the underlying data store.

Polished transactional metadata declaration in JPA- and MongoDB-based repository implementations.

Tightened nullability expressions here and there.
2023-09-04 15:24:37 +02:00
Oliver Drotbohm
ddaf34d4d8 GH-274 - Prepare next development iteration. 2023-08-21 07:00:02 -07:00
Oliver Drotbohm
6197d35937 GH-274 - Release version 1.0.0. 2023-08-21 06:59:57 -07:00
Oliver Drotbohm
39ce5346c6 GH-270 - Prepare next development iteration. 2023-08-16 08:05:46 +02:00
Oliver Drotbohm
2c5cedd1d1 GH-270 - Release version 1.0.0-RC2. 2023-08-16 08:05:46 +02:00
Oliver Drotbohm
0bfdb81d91 GH-265 - Use EVENT_PUBLICATION as table name for JPA to be consistent with JDBC. 2023-08-12 07:50:37 +02:00
Oliver Drotbohm
1e1ebb52ff GH-266 - Use event_publication collection for MongoDB event publications. 2023-08-12 07:50:37 +02:00
Oliver Drotbohm
967556d014 GH-264 - Only register EventPublicationRegistry if EventPublicationRepository present.
We now clearly separate between strict configuration, usable via @EnablePersistentDomainEvents and the auto-configuration for EventPublicationRegistry infrastructure. This allows using the core JAR in scenarios, in which no registry functionality is needed.
2023-08-12 07:49:43 +02:00
Oliver Drotbohm
0de48790d7 GH-261 - Avoid materializing JpaEventPublication to mark it completed.
We now simply issue an update query.
2023-08-10 00:19:35 +02:00
Oliver Drotbohm
1a84ae256f GH-260 - Prepare next development iteration. 2023-08-09 22:29:57 +02:00
Oliver Drotbohm
bf68d74756 GH-260 - Release version 1.0.0-RC1. 2023-08-09 22:29:56 +02:00
Oliver Drotbohm
31efdb31a2 GH-259 - Rename modulith.events package to modulith.events.core.
Allows us to eventually use the former as user-facing API package in a to-be-introduced API JAR.
2023-08-09 22:05:08 +02:00
Oliver Drotbohm
afe77711f1 GH-212 - Invert default for event republication to false.
This is to accommodate cluster setups and avoid multiple instances from resubmitting outstanding event publications concurrently.
2023-08-09 21:21:18 +02:00
Oliver Drotbohm
79e465c10e GH-251 - Improve efficiency of event publication completion.
Changed the EventPublicationRepository interface to allow marking an event as completed without having to materialize it in the first place. This allows us to get rid of CompletableEventPublication. EventPublication not exposes its identifier to make sure the stores can actually store the same id.

Introduced EventPublicationRegistry.deleteCompletedPublicationsOlderThan(Duration) to purge completed event publications before a given point in time.
2023-08-09 21:21:18 +02:00
Oliver Drotbohm
29b78a447e GH-206 - Polishing.
Javadoc in CompletableEventPublication.
2023-07-19 17:16:53 +02:00
Oliver Drotbohm
303a6802d8 GH-206 - Event Publication Registry now uses custom Clock instance if configured.
We now consider a user defined Clock bean in the application context to obtain the Instant to use as publication date for event publications.
2023-07-19 17:16:20 +02:00
Oliver Drotbohm
4fd17a80eb GH-239 - Polishing. 2023-07-18 19:03:15 +02:00
Oliver Drotbohm
2270ff39ec GH-240 - Republication of outstanding events can now be disabled.
Via the spring.modulith.republish-outstanding-events-on-restart (boolean) property.
2023-07-17 13:35:45 +02:00
Oliver Drotbohm
ff32c609fc GH-239 - Removed workaround after the downstream issue has been fixed in Spring Framework.
Related ticket: GH-186, spring-projects/spring-framework#30399.
2023-07-17 13:15:50 +02:00
Oliver Drotbohm
f8da2e86a8 GH-232 - Improve configuration property metadata in Event Publication Registry. 2023-07-05 17:34:23 +02:00
Oliver Drotbohm
fd478cbed5 GH-231 - Fix typo in property controlling the MongoDB Event Publication Registry's default transaction management. 2023-07-05 14:13:52 +02:00
Oliver Drotbohm
5e2da724da GH-199 - Prepare next development iteration. 2023-06-23 12:55:10 +02:00
Oliver Drotbohm
a74c4e582d GH-199 - Release version 1.0.0-M1. 2023-06-23 12:55:09 +02:00
Oliver Drotbohm
0dd2200302 GH-195 - Unnest test cases to make sure we run the right profiles.
Remove the nesting of the test classes as they will be executed without profiles activated.
2023-06-23 12:49:06 +02:00
Oliver Drotbohm
068916aa54 GH-195 - Remove support for legacy spring.modulith.jdbc-… namespace in JDBC-based event support. 2023-06-23 12:49:06 +02:00
Oliver Drotbohm
596e8828a2 GH-197 - Promote project out of experimental status.
Set version number to 1.0.0-SNAPSHOT. New group id is org.springframework.modulith. Also adapt links to new project home.
2023-05-02 14:32:32 +02:00
Oliver Drotbohm
60ce7da56e GH-189 - Prepare next development iteration. 2023-05-02 12:28:30 +02:00
Oliver Drotbohm
9d1180017e GH-189 - Release version 0.6.0. 2023-05-02 12:28:29 +02:00
Oliver Drotbohm
94093a3081 GH-175 - More defensive auto-configuration of MongoDB transactions.
We now opt out of defining bean definitions for MongoTransactionManager and TransactionTemplate if user defined. We also make sure to run before the EnableTransactionManagementConfiguration to make sure that will see our auto-configured MongoTransactionManager.
2023-05-01 22:30:29 +02:00
Oliver Drotbohm
c46b9b958d GH-196 - Upgrade to Hibernate 6.2.2 for JPA event publication registry tests. 2023-05-01 21:56:54 +02:00
Oliver Drotbohm
f0c38e1085 GH-194 - Fix combined condition to enable JDBC database initialization. 2023-05-01 21:56:54 +02:00
Oliver Drotbohm
0fbd776239 GH-194 - Switch to spring.modulith.events.jdbc.… namspace for data initialization properties.
The legacy ones are still supported but the data initialization properties have been moved to a new spring.modulith.events.jdbc.… namespace.
2023-05-01 21:33:49 +02:00
Oliver Drotbohm
646722beaf GH-175 - Auto-configure transactions for MongoDB by default.
As the Event Publication registry only works in transactional environments, we should enable them for MongoDB by default. This will require a replica setup for the MongoDB instance the application interacts with.
2023-05-01 21:28:08 +02:00
Oliver Drotbohm
c9729bded0 GH-186 - Workaround for invalid application listener matching in AbstractApplicationEventMulticaster.
AbstractApplicationEventMulticaster.supportsEvent(…) currently doesn't properly match unresolved, generic ApplicationEvents (see [0]). We now work around this problem by additionally matching the raw event types in a custom override of supportsEvent(…).

[0] https://github.com/spring-projects/spring-framework/issues/30399
2023-04-30 22:35:14 +02:00
Oliver Drotbohm
b834c255ec GH-184 - Enable asynchronous support when using event publication registry.
Unless manually configured we now configure @EnableAsync by default in the event publication registry module.
2023-04-24 14:43:37 +02:00
Oliver Drotbohm
29a5148dcb GH-181 - Delay lookup of EventPublicationRegistry as much as possible.
We now avoid to initialize the EventPublicationRegistry in the ApplicationEventMulticaster unless there is a transactional event listener interested in the event to be published. This should help us avoid premature initialization of the registry for application events published early in the application context bootstrap phase.
2023-04-23 23:56:23 +02:00
Oliver Drotbohm
281da55eac GH-172 - Prepare next development iteration. 2023-03-24 10:24:47 +01:00
Oliver Drotbohm
d5bdff3f77 GH-172 - Release version 0.5.1. 2023-03-24 10:24:47 +01:00
Oliver Drotbohm
f0aaca2917 GH-164 - Prepare next development iteration. 2023-03-08 11:35:15 +01:00
Oliver Drotbohm
50dd8969fb GH-164 - Release version 0.5.0. 2023-03-08 11:35:14 +01:00
Oliver Drotbohm
5ba5db07a6 GH-159 - Unit tests for JDBC schema resolution. 2023-03-08 10:47:52 +01:00
Michael Weirauch
0e2e404308 GH-159 - Fix JDBC schema loading from classpath in servlet environments. 2023-03-08 10:47:14 +01:00
Oliver Drotbohm
bb760e970c GH-163 - Fix wrong property name in integration test configuration. 2023-03-08 09:51:28 +01:00
Michael Weirauch
23e4bc5698 GH-158 - Add configuration metadata for spring-modulith-events-jdbc 2023-03-07 16:37:48 +01:00
Oliver Drotbohm
cac1a71dd2 GH-163 - Change spring.modulith.events.schema-initialization.enabled to spring.modulith.events.jdbc-schema-initialization.enabled. 2023-03-07 16:30:29 +01:00