You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/docs/antora/modules/ROOT/pages/events.adoc
+28-17Lines changed: 28 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -209,6 +209,32 @@ By default, all incomplete event publications are resubmitted at application sta
209
209
.The transactional event listener arrangement after execution
210
210
image::event-publication-registry-end.png[]
211
211
212
+
[[publication-registry.starters]]
213
+
=== Spring Boot Event Registry Starters
214
+
215
+
Using the transactional event publication log requires a combination of artifacts added to your application. To ease that task, Spring Modulith provides starter POMs that are centered around the <<publication-registry.publication-repositories, persistence technology>> to be used and default to the Jackson-based <<publication-registry.serialization, EventSerializer>> implementation. The following starters are available:
216
+
217
+
[%header,cols="1,3,6"]
218
+
|===
219
+
|Persistence Technology|Artifact|Description
220
+
221
+
|JPA
222
+
|`spring-modulith-starter-jpa`
223
+
|Using JPA as persistence technology.
224
+
225
+
|JDBC
226
+
|`spring-modulith-starter-jdbc`
227
+
|Using JDBC as persistence technology. Also works in JPA-based applications but bypasses your JPA provider for actual event persistence.
228
+
229
+
|MongoDB
230
+
|`spring-modulith-starter-mongodb`
231
+
|Using JDBC as persistence technology. Also enables MongoDB transactions and requires a replica set setup of the server to interact with. The transaction auto-configuration can be disabled by setting the `spring.modulith.events.mongobd.transaction-management.enabled` property to `false`.
232
+
233
+
|Neo4j
234
+
|`spring-modulith-starter-neo4j`
235
+
|Using Neo4j behind Spring Data Neo4j.
236
+
|===
237
+
212
238
[[publication-registry.managing-publications]]
213
239
=== Managing Event Publications
214
240
@@ -288,7 +314,7 @@ Some of the events exchanged between application modules might be interesting to
288
314
Spring Modulith allows publishing selected events to a variety of message brokers.
289
315
To use that support you need to take the following steps:
290
316
291
-
1. Add the <<events.externalization.infrastructure, broker-specific Spring Modulith artifact>> to your project.
317
+
1. Add the <<externalization.infrastructure, broker-specific Spring Modulith artifact>> to your project.
292
318
2. Select event types to be externalized by annotating them with either Spring Modulith's or jMolecules' `@Externalized` annotation.
293
319
3. Specify the broker-specific routing target in the annotation's value.
294
320
@@ -465,7 +491,7 @@ Alternatively, a full `RoutingKey` can be produced for individual events by usin
465
491
== Testing published events
466
492
467
493
NOTE: The following section describes a testing approach solely focused on tracking Spring application events.
468
-
For a more holistic approach on testing modules that use <<events.aml, `@ApplicationModuleListener`>>, please check out the <<testing.scenarios, `Scenario` API>>.
494
+
For a more holistic approach on testing modules that use xref:testing.adoc[`@ApplicationModuleListener`], please check out the xref:testing.adoc#scenarios[`Scenario` API].
469
495
470
496
Spring Modulith's `@ApplicationModuleTest` enables the ability to get a `PublishedEvents` instance injected into the test method to verify a particular set of events has been published during the course of the business operation under test.
471
497
@@ -554,18 +580,3 @@ class OrderIntegrationTests {
554
580
======
555
581
556
582
Note, how the type returned by the `assertThat(…)` expression allows to define constraints on the published events directly.
557
-
558
-
[[starters]]
559
-
== Spring Boot Event Registry Starters
560
-
561
-
Using the transactional event publication log requires a combination of artifacts added to your application.
562
-
To ease that task, Spring Modulith provides starter POMs that are centered around the xref:events.adoc#publication-registry.publication-repositories[persistence technology] to be used and default to the Jackson-based `EventSerializer` implementation.
563
-
The following starters are available:
564
-
565
-
* `spring-modulith-starter-jpa` -- Using JPA as persistence technology.
566
-
* `spring-modulith-starter-jdbc` -- Using JDBC as persistence technology.
567
-
Also works in JPA-based applications but bypasses your JPA provider for actual event persistence.
568
-
* `spring-modulith-starter-mongodb` -- Using MongoDB behind Spring Data MongoDB.
569
-
Also enables MongoDB transactions and requires a replica set setup of the server to interact with.
570
-
The transaction auto-configuration can be disabled by setting the `spring.modulith.events.mongobd.transaction-management.enabled` property to `false`.
571
-
* `spring-modulith-starter-neo4j` -- Using Neo4j behind Spring Data Neo4j.
Copy file name to clipboardExpand all lines: src/docs/antora/modules/ROOT/pages/testing.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -107,7 +107,7 @@ class InventoryIntegrationTests {
107
107
Spring Boot will create bean definitions and instances for the types defined as `@MockBean` and add them to the `ApplicationContext` bootstrapped for the test run.
108
108
109
109
If you find your application module depending on too many beans of other ones, that is usually a sign of high coupling between them.
110
-
The dependencies should be reviewed for whether they are candidates for replacement by publishing a domain event (see xref:events.adoc#events[null]).
110
+
The dependencies should be reviewed for whether they are candidates for replacement by publishing xref:events.adoc#events[domain events].
0 commit comments