From 9382e413bf99cf0cb93d5593ca6cbb75f0557ee9 Mon Sep 17 00:00:00 2001 From: Marc Piechura Date: Sat, 25 Oct 2025 16:33:01 +0200 Subject: [PATCH 1/2] Enhance archiving documentation with event processing details Added details on how Marten handles archived events and multi-stream projections. --- docs/events/archiving.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/events/archiving.md b/docs/events/archiving.md index fc28338368..eec57256c8 100644 --- a/docs/events/archiving.md +++ b/docs/events/archiving.md @@ -240,3 +240,16 @@ for the `Order` will be marked as archived. This was originally conceived as a way to improve the Wolverine aggregate handler workflow usability while also encouraging Marten users to take advantage of the event archiving feature. ::: + +::: info +When an `Archived` event is appended to a stream (as described above), Marten will mark the entire event stream as archived once that event is processed. + +As a result, asynchronous multi-stream projections will no longer process any other events from that stream, even if those events appear earlier in the sequence or were added in a different session and have not yet been processed. + +If you rely on asynchronous multi-stream projections and need all events to be processed before archiving, you can work around this by either: + +- Writing the `Archived` event as a side effect within your asynchronous projection, after all other events have been processed, or +- Delaying the archiving by publishing a scheduled or delayed message (for example, when using Marten together with Wolverine) that appends the `Archived` event after projection completion. + +This ensures all prior events are fully projected before the stream is marked as archived. +::: From 6235b16358c8479a658f3cc3f1580073af04660b Mon Sep 17 00:00:00 2001 From: Marc Piechura Date: Sat, 25 Oct 2025 16:37:18 +0200 Subject: [PATCH 2/2] Fix formatting of archiving workarounds in documentation --- docs/events/archiving.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/events/archiving.md b/docs/events/archiving.md index eec57256c8..a1b95bb8f6 100644 --- a/docs/events/archiving.md +++ b/docs/events/archiving.md @@ -248,8 +248,8 @@ As a result, asynchronous multi-stream projections will no longer process any ot If you rely on asynchronous multi-stream projections and need all events to be processed before archiving, you can work around this by either: -- Writing the `Archived` event as a side effect within your asynchronous projection, after all other events have been processed, or -- Delaying the archiving by publishing a scheduled or delayed message (for example, when using Marten together with Wolverine) that appends the `Archived` event after projection completion. +* Writing the `Archived` event as a side effect within your asynchronous projection, after all other events have been processed, or +* Delaying the archiving by publishing a scheduled or delayed message (for example, when using Marten together with Wolverine) that appends the `Archived` event after projection completion. This ensures all prior events are fully projected before the stream is marked as archived. :::