Skip to content

Commit a534811

Browse files
committed
GH-806 - Reference documentation for archiving event publication completion mode.
1 parent b189dbc commit a534811

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@
1919
Can either be the class name of a custom implementation of `ApplicationModuleDetectionStrategy` or `direct-subpackages` (which is also the final fallback if nothing is configured) or `explicitly-annotated` to only select packages explicitly annotated with `@ApplicationModule` or jMolecules' `@Module`. See xref:fundamentals.adoc#customizing-modules[Customize Application Module Detection] for details.
2020

2121
|`spring.modulith.events.completion-mode`
22-
|`UPDATE`
23-
|How to mark event publications as completed. The default sets the completion date on the database entry, `DELETE` removes the entry right away. For details, see xref:events.adoc#publication-registry.completion[Event Publication Completion].
22+
|`update`
23+
a|How to mark an event publication as completed.
24+
The following values are supported:
25+
26+
* `update` (default) -- Sets the completion date on the event publication entry.
27+
* `delete` -- Removes the event publication entry.
28+
Completed event publications are not available via `CompletedEventPublications`.
29+
* `archive` -- Removes the event publication entry from the primary database abstraction (table, collection or node) and creates one in a archive (a table, collection or node of same schema).
30+
For details, see xref:events.adoc#publication-registry.completion[Event Publication Completion].
2431

2532
|`spring.modulith.events.externalization.enabled`
2633
|`true`

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,15 @@ This means that completed publications will remain in the Event Publication Regi
286286
A consequence of this is that you'll need to put some code in place that will periodically purge old, completed ``EventPublication``s.
287287
Otherwise, the persistent abstraction of them, for example a relational database table, will grow unbounded and the interaction with the store creating and completing new ``EventPublication`` might slow down.
288288

289-
Spring Modulith 1.3 introduces a configuration property `spring.modulith.events.completion-mode`.
289+
Spring Modulith 1.3 introduces a configuration property `spring.modulith.events.completion-mode` to support two additional modes of completion.
290290
It defaults to `UPDATE` which is backed by the strategy described above.
291291
Alternatively, the completion mode can be set to `DELETE`, which alters the registry's persistence mechanisms to rather delete ``EventPublication``s on completion.
292292
This means that `CompletedEventPublications` will not return any publications anymore, but at the same time, you don't have to worry about purging the completed events from the persistence store manually anymore.
293293

294+
The third option is the `ARCHIVE` mode, which copies the entry into an archive table, collection or node.
295+
For that archive entry, the completion date is set and the original entry is removed.
296+
Contrary to the `DELETE` mode, completed event publications are then still accessible via the `CompletedEventPublications` abstraction.
297+
294298
[[publication-registry.publication-repositories]]
295299
=== Event Publication Repositories
296300

0 commit comments

Comments
 (0)