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: spring-modulith-events/spring-modulith-events-api/src/main/java/org/springframework/modulith/events/RoutingTarget.java
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-messaging/src/main/java/org/springframework/modulith/events/messaging/SpringMessagingEventExternalizerConfiguration.java
Copy file name to clipboardExpand all lines: spring-modulith-events/spring-modulith-events-messaging/src/test/java/org/springframework/modulith/events/messaging/SpringMessagingEventPublicationIntegrationTests.java
+15-7
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
/*
2
-
* Copyright 2023-2024 the original author or authors.
2
+
* Copyright 2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
Copy file name to clipboardExpand all lines: src/docs/antora/modules/ROOT/pages/appendix.adoc
+1
Original file line number
Diff line number
Diff line change
@@ -167,6 +167,7 @@ a|* `spring-modulith-docs`
167
167
|`spring-modulith-events-jms`|`runtime`|Event externalization support for JMS.
168
168
|`spring-modulith-events-jpa`|`runtime`|A JPA-based implementation of the `EventPublicationRegistry`.
169
169
|`spring-modulith-events-kafka`|`runtime`|Event externalization support for Kafka.
170
+
|`spring-modulith-events-messaging`|`runtime`|Event externalization support into Spring Messaging ``MessageChannel``s.
170
171
|`spring-modulith-events-mongodb`|`runtime`|A MongoDB-based implementation of the `EventPublicationRegistry`.
171
172
|`spring-modulith-events-neo4j`|`runtime`|A Neo4j-based implementation of the `EventPublicationRegistry`.
172
173
|`spring-modulith-junit`|`test`|Test execution optimizations based on the application module structure. Find more details xref:testing.adoc#change-aware-test-execution[here].
Copy file name to clipboardExpand all lines: src/docs/antora/modules/ROOT/pages/events.adoc
+8-3
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ To keep application modules as decoupled as possible from each other, their prim
7
7
This avoids the originating module to know about all potentially interested parties, which is a key aspect to enable application module integration testing (see xref:testing.adoc[Integration Testing Application Modules]).
8
8
9
9
Often we will find application components defined like this:
10
+
10
11
[tabs]
11
12
======
12
13
Java::
@@ -124,6 +125,7 @@ class InventoryManagement {
124
125
}
125
126
----
126
127
======
128
+
127
129
This now effectively decouples the original transaction from the execution of the listener.
128
130
While this avoids the expansion of the original business transaction, it also creates a risk: if the listener fails for whatever reason, the event publication is lost, unless each listener actually implements its own safety net.
129
131
Even worse, that doesn't even fully work, as the system might fail before the method is even invoked.
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:
217
+
Using the transactional event publication log requires a combination of artifacts added to your application.
218
+
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.
219
+
The following starters are available:
216
220
217
221
[%header,cols="1,3,6"]
218
222
|===
@@ -306,6 +310,7 @@ Spring Modulith provides a Jackson-based JSON implementation through the `spring
By default, the Event Publication Registry will use the date returned by the `Clock.systemUTC()` as event publication date.
310
315
If you want to customize this, register a bean of type clock with the application context:
311
316
@@ -372,7 +377,8 @@ When routing key is set, requires SNS to be configured as a FIFO topic with cont
372
377
|Spring Messaging
373
378
|`spring-modulith-events-messaging`
374
379
|Uses Spring's core `Message` and `MessageChannel` support.
375
-
Resolves the target `MessageChannel` by its bean name given the `target` in the `Externalized` annotation. Forwards routing information as a header - called `modulithRouting` - to be processed in whatever way by downstream components, typically in a Spring Integration `IntegrationFlow`.
380
+
Resolves the target `MessageChannel` by its bean name given the `target` in the `Externalized` annotation.
381
+
Forwards routing information as a header - called `springModulith_routingTarget` - to be processed in whatever way by downstream components, typically in a Spring Integration `IntegrationFlow`.
The `spring-modulith-events-api` artifact contains `EventExternalizationConfiguration` that allows developers to customize all of the above mentioned steps.
0 commit comments