Class ArchivePolicy
- Namespace
- Excalibur.EventSourcing
- Assembly
- Excalibur.EventSourcing.Abstractions.dll
Configuration for event archival policies that determine which events should be moved from hot to cold storage.
public sealed class ArchivePolicy
- Inheritance
-
ArchivePolicy
- Inherited Members
Remarks
Age and global-position thresholds are alternative eligibility triggers. Retention is an overriding minimum hot suffix, ordered by aggregate version, and can be used without either trigger. Only a prefix ending before the first ineligible payload can be archived; timestamps need not follow version order. Already archived markers are not pending work. Erasure markers and unexplained missing payloads stop the prefix. With no criteria configured, no events are eligible. A covering snapshot is not required: payload removal requires a confirmed, recoverable contiguous cold-history prefix. Snapshots are an optimization and cannot substitute for replayable history.
Properties
MaxAge
Gets or sets the maximum age for events in hot storage. Events older than this are eligible for archival.
public TimeSpan? MaxAge { get; set; }
Property Value
MaxPosition
Gets or sets the maximum global position for events in hot storage. Events strictly before this global position are eligible for archival; equality is excluded.
public long? MaxPosition { get; set; }
Property Value
RetainRecentCount
Gets or sets the number of newest events, ordered by aggregate version, protected from archival. This overrides age and position eligibility. Used alone, it makes the older prefix eligible.
public int? RetainRecentCount { get; set; }