JournalEntry

data class JournalEntry<P>(val runId: RunId, val seq: Long, val step: TypedValue?, val phase: EntryPhase, val payload: P, val reverses: Long? = null, val createdAtMillis: Long, val metadata: Map<String, String> = emptyMap())

An immutable record of a single event within a saga run.

JournalEntry is a transport record (not a domain entity). All fields are set at append time and never mutated.

ByteArray payload caveat: if P = ByteArray, Kotlin's data class equals / hashCode compares by reference, not by content. Wrap ByteArray in a value class or use List<Byte> if structural equality is required.

Parameters

P

Payload type stored by this journal instance.

Constructors

Link copied to clipboard
constructor(runId: RunId, seq: Long, step: TypedValue?, phase: EntryPhase, payload: P, reverses: Long? = null, createdAtMillis: Long, metadata: Map<String, String> = emptyMap())

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Wall-clock epoch millis at append time. Advisory only — seq is the authoritative ordering within a run.

Link copied to clipboard

Arbitrary string key/value pairs attached to the entry. The F004 effect-key is stored under EFFECT_KEY_METADATA. Defaults to emptyMap — source-compatible with pre-1.8.0 call sites.

Link copied to clipboard
val payload: P

Opaque payload value. The executor never inspects payload bytes; all decisions use step, phase, seq, and runId metadata only.

Link copied to clipboard

Lifecycle phase — see EntryPhase.

Link copied to clipboard

For EntryPhase.Compensation entries: the seq of the EntryPhase.Effect entry being undone. null for all other phases.

Link copied to clipboard

Identifies which saga run this entry belongs to.

Link copied to clipboard
val seq: Long

Zero-based monotonic sequence number within the run. Gapless.

Link copied to clipboard

The saga step this entry relates to, or null for EntryPhase.Started / EntryPhase.Terminal entries.