Skip to content

Commit 3d68f1a

Browse files
etrandafir93odrotbohm
authored andcommitted
GH-521 - Improve reference docs.
Making the starters section more visible. Fixed links related to testing.
1 parent e41d7ec commit 3d68f1a

File tree

2 files changed

+29
-18
lines changed

2 files changed

+29
-18
lines changed

src/docs/antora/modules/ROOT/pages/events.adoc

Lines changed: 28 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,32 @@ By default, all incomplete event publications are resubmitted at application sta
209209
.The transactional event listener arrangement after execution
210210
image::event-publication-registry-end.png[]
211211
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+
212238
[[publication-registry.managing-publications]]
213239
=== Managing Event Publications
214240
@@ -288,7 +314,7 @@ Some of the events exchanged between application modules might be interesting to
288314
Spring Modulith allows publishing selected events to a variety of message brokers.
289315
To use that support you need to take the following steps:
290316
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.
292318
2. Select event types to be externalized by annotating them with either Spring Modulith's or jMolecules' `@Externalized` annotation.
293319
3. Specify the broker-specific routing target in the annotation's value.
294320
@@ -465,7 +491,7 @@ Alternatively, a full `RoutingKey` can be produced for individual events by usin
465491
== Testing published events
466492
467493
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].
469495
470496
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.
471497
@@ -554,18 +580,3 @@ class OrderIntegrationTests {
554580
======
555581
556582
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.

src/docs/antora/modules/ROOT/pages/testing.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class InventoryIntegrationTests {
107107
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.
108108

109109
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].
111111

112112
[[scenarios]]
113113
== Defining Integration Test Scenarios

0 commit comments

Comments
 (0)