| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Keiro.Outbox.Types
Description
Shared types for the durable integration-event outbox.
The outbox is the durable handoff between "this service has decided to publish this integration event" and "this service has actually published it". The producer subscription writes one outbox row per mapped private event; the publisher worker drains rows into Kafka and marks each one sent, retryable, or dead.
Synopsis
- newtype OutboxId = OutboxId {
- unOutboxId :: UUID
- data OutboxStatus
- data OrderingPolicy
- data BackoffSchedule
- data ExponentialBackoffOptions = ExponentialBackoffOptions {}
- data OutboxMessage = OutboxMessage {}
- data OutboxRow = OutboxRow {
- outboxId :: !OutboxId
- event :: !IntegrationEvent
- status :: !OutboxStatus
- attemptCount :: !Int
- nextAttemptAt :: !UTCTime
- lastError :: !(Maybe Text)
- publishedAt :: !(Maybe UTCTime)
- createdAt :: !UTCTime
- updatedAt :: !UTCTime
- data OutboxPublishOptions = OutboxPublishOptions {
- batchSize :: !Int
- maxAttempts :: !Int
- backoff :: !BackoffSchedule
- orderingPolicy :: !OrderingPolicy
- publishingTimeout :: !NominalDiffTime
- tracer :: !(Maybe Tracer)
- data OutboxPublishConfigError
- = InvalidOutboxBatchSize !Int
- | InvalidOutboxMaxAttempts !Int
- | InvalidOutboxPublishingTimeout !NominalDiffTime
- | InvalidConstantBackoff !NominalDiffTime
- | InvalidExponentialBackoffInitial !NominalDiffTime
- | InvalidExponentialBackoffMultiplier !Double
- | InvalidExponentialBackoffMaxDelay !NominalDiffTime !NominalDiffTime
- data OutboxPublishSummary = OutboxPublishSummary {}
- data OutboxMaintenanceOptions = OutboxMaintenanceOptions {}
- data OutboxMaintenanceSummary = OutboxMaintenanceSummary {}
- defaultPublishOptions :: OutboxPublishOptions
- defaultMaintenanceOptions :: OutboxMaintenanceOptions
- mkOutboxPublishOptions :: OutboxPublishOptions -> Either OutboxPublishConfigError OutboxPublishOptions
- statusText :: OutboxStatus -> Text
- parseStatus :: Text -> Either Text OutboxStatus
- nextDelay :: BackoffSchedule -> Int -> NominalDiffTime
Documentation
Primary key of a keiro_outbox row. Stable across publish retries.
Constructors
| OutboxId | |
Fields
| |
Instances
| Generic OutboxId Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
| |||||
| Show OutboxId Source # | |||||
| Eq OutboxId Source # | |||||
| Ord OutboxId Source # | |||||
Defined in Keiro.Outbox.Types | |||||
| FromJSON OutboxId Source # | |||||
Defined in Keiro.Outbox.Types | |||||
| ToJSON OutboxId Source # | |||||
| type Rep OutboxId Source # | |||||
Defined in Keiro.Outbox.Types | |||||
data OutboxStatus Source #
Lifecycle state of an outbox row.
OutboxPending— never attempted.OutboxPublishing— currently held by a publisher worker (between claim and the call to mark sentfaileddead). Rows left in this state after a worker crash are reclaimed byoutboxMaintenancePassafterpublishingTimeout.OutboxSent— Kafka acknowledged the publish; terminal.OutboxFailed— last attempt failed; will be retried afternext_attempt_at.OutboxDead— terminal failure aftermaxAttemptsconsecutive failures. Stays in the table for operator inspection.
Constructors
| OutboxPending | |
| OutboxPublishing | |
| OutboxSent | |
| OutboxFailed | |
| OutboxDead |
Instances
data OrderingPolicy Source #
Ordering policy enforced by the publisher worker's claim query.
PerKeyHeadOfLine(default) — within asource, a non-terminal row with keykblocks every later row with the same key. Rows withNothingkey bypass the block (Kafka does not promise cross-key order for null-keyed records). One stuck aggregate cannot stall traffic on other aggregates. Ordering is based oncreated_at, which PostgreSQL sets to transaction-start time; callers that concurrently enqueue the same key through escape hatches must serialize those enqueues themselves if commit order matters.PerSourceStream— within asource, any non-terminal row blocks every later row. Use when ordering matters across keys (rare). This has the samecreated_atconcurrency caveat asPerKeyHeadOfLine.StopTheLine— any failure halts the worker until operator intervention. Use when correctness requires manual review on every failure.BestEffort— failed rows do not block; explicit opt-in only. Safe only when published events have no per-key/causal relationship.
Constructors
| PerKeyHeadOfLine | |
| PerSourceStream | |
| StopTheLine | |
| BestEffort |
Instances
| Generic OrderingPolicy Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OrderingPolicy -> Rep OrderingPolicy x # to :: Rep OrderingPolicy x -> OrderingPolicy # | |||||
| Show OrderingPolicy Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OrderingPolicy -> ShowS # show :: OrderingPolicy -> String # showList :: [OrderingPolicy] -> ShowS # | |||||
| Eq OrderingPolicy Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OrderingPolicy -> OrderingPolicy -> Bool # (/=) :: OrderingPolicy -> OrderingPolicy -> Bool # | |||||
| type Rep OrderingPolicy Source # | |||||
Defined in Keiro.Outbox.Types type Rep OrderingPolicy = D1 ('MetaData "OrderingPolicy" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) ((C1 ('MetaCons "PerKeyHeadOfLine" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PerSourceStream" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "StopTheLine" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "BestEffort" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data BackoffSchedule Source #
Backoff curve used to compute next_attempt_at after a failure.
ConstantBackoff— fixed delay between retries.ExponentialBackoff— exponential growth capped atmaxDelay.
Instances
| Generic BackoffSchedule Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: BackoffSchedule -> Rep BackoffSchedule x # to :: Rep BackoffSchedule x -> BackoffSchedule # | |||||
| Show BackoffSchedule Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> BackoffSchedule -> ShowS # show :: BackoffSchedule -> String # showList :: [BackoffSchedule] -> ShowS # | |||||
| Eq BackoffSchedule Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: BackoffSchedule -> BackoffSchedule -> Bool # (/=) :: BackoffSchedule -> BackoffSchedule -> Bool # | |||||
| type Rep BackoffSchedule Source # | |||||
Defined in Keiro.Outbox.Types type Rep BackoffSchedule = D1 ('MetaData "BackoffSchedule" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "ConstantBackoff" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)) :+: C1 ('MetaCons "ExponentialBackoff" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ExponentialBackoffOptions))) | |||||
data ExponentialBackoffOptions Source #
Knobs for ExponentialBackoff. delay = min maxDelay (initial * multiplier ^ (attempt - 1)).
Constructors
| ExponentialBackoffOptions | |
Fields
| |
Instances
| Generic ExponentialBackoffOptions Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: ExponentialBackoffOptions -> Rep ExponentialBackoffOptions x # to :: Rep ExponentialBackoffOptions x -> ExponentialBackoffOptions # | |||||
| Show ExponentialBackoffOptions Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> ExponentialBackoffOptions -> ShowS # show :: ExponentialBackoffOptions -> String # showList :: [ExponentialBackoffOptions] -> ShowS # | |||||
| Eq ExponentialBackoffOptions Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: ExponentialBackoffOptions -> ExponentialBackoffOptions -> Bool # (/=) :: ExponentialBackoffOptions -> ExponentialBackoffOptions -> Bool # | |||||
| type Rep ExponentialBackoffOptions Source # | |||||
Defined in Keiro.Outbox.Types type Rep ExponentialBackoffOptions = D1 ('MetaData "ExponentialBackoffOptions" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "ExponentialBackoffOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "initial") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: (S1 ('MetaSel ('Just "maxDelay") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "multiplier") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)))) | |||||
data OutboxMessage Source #
A request to enqueue one integration event into the outbox. Callers
generate outboxId (use a random UUID for ad-hoc enqueues, a
deterministic UUID for idempotent retries from a saga/process manager).
Constructors
| OutboxMessage | |
Instances
| Generic OutboxMessage Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
| |||||
| Show OutboxMessage Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OutboxMessage -> ShowS # show :: OutboxMessage -> String # showList :: [OutboxMessage] -> ShowS # | |||||
| Eq OutboxMessage Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OutboxMessage -> OutboxMessage -> Bool # (/=) :: OutboxMessage -> OutboxMessage -> Bool # | |||||
| type Rep OutboxMessage Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxMessage = D1 ('MetaData "OutboxMessage" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxMessage" 'PrefixI 'True) (S1 ('MetaSel ('Just "outboxId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OutboxId) :*: S1 ('MetaSel ('Just "event") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IntegrationEvent))) | |||||
A row read back from keiro_outbox. Worker code consumes these to
publish to Kafka; tests use them to assert state transitions.
Constructors
| OutboxRow | |
Fields
| |
Instances
| Generic OutboxRow Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
| |||||
| Show OutboxRow Source # | |||||
| Eq OutboxRow Source # | |||||
| type Rep OutboxRow Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxRow = D1 ('MetaData "OutboxRow" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxRow" 'PrefixI 'True) (((S1 ('MetaSel ('Just "outboxId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OutboxId) :*: S1 ('MetaSel ('Just "event") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 IntegrationEvent)) :*: (S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OutboxStatus) :*: S1 ('MetaSel ('Just "attemptCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int))) :*: ((S1 ('MetaSel ('Just "nextAttemptAt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "lastError") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "publishedAt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe UTCTime)) :*: (S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime) :*: S1 ('MetaSel ('Just "updatedAt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime)))))) | |||||
data OutboxPublishOptions Source #
Knobs that govern one invocation of publishClaimedOutbox.
The optional tracer field opts the publisher into OpenTelemetry
instrumentation: when present, the publisher opens a Producer-kind
span around each publish call, attributing the first row's
destination (topic), messageId,
and Kafka key per the messaging semantic conventions. When tracer is
Nothing (the default) the publisher emits no spans.
Constructors
| OutboxPublishOptions | |
Fields
| |
Instances
| Generic OutboxPublishOptions Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OutboxPublishOptions -> Rep OutboxPublishOptions x # to :: Rep OutboxPublishOptions x -> OutboxPublishOptions # | |||||
| type Rep OutboxPublishOptions Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxPublishOptions = D1 ('MetaData "OutboxPublishOptions" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxPublishOptions" 'PrefixI 'True) ((S1 ('MetaSel ('Just "batchSize") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "maxAttempts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "backoff") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 BackoffSchedule))) :*: (S1 ('MetaSel ('Just "orderingPolicy") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 OrderingPolicy) :*: (S1 ('MetaSel ('Just "publishingTimeout") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "tracer") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Tracer)))))) | |||||
data OutboxPublishConfigError Source #
Constructors
| InvalidOutboxBatchSize !Int | |
| InvalidOutboxMaxAttempts !Int | |
| InvalidOutboxPublishingTimeout !NominalDiffTime | |
| InvalidConstantBackoff !NominalDiffTime | |
| InvalidExponentialBackoffInitial !NominalDiffTime | |
| InvalidExponentialBackoffMultiplier !Double | |
| InvalidExponentialBackoffMaxDelay !NominalDiffTime !NominalDiffTime |
Instances
| Generic OutboxPublishConfigError Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OutboxPublishConfigError -> Rep OutboxPublishConfigError x # to :: Rep OutboxPublishConfigError x -> OutboxPublishConfigError # | |||||
| Show OutboxPublishConfigError Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OutboxPublishConfigError -> ShowS # show :: OutboxPublishConfigError -> String # showList :: [OutboxPublishConfigError] -> ShowS # | |||||
| Eq OutboxPublishConfigError Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OutboxPublishConfigError -> OutboxPublishConfigError -> Bool # (/=) :: OutboxPublishConfigError -> OutboxPublishConfigError -> Bool # | |||||
| type Rep OutboxPublishConfigError Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxPublishConfigError = D1 ('MetaData "OutboxPublishConfigError" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) ((C1 ('MetaCons "InvalidOutboxBatchSize" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: (C1 ('MetaCons "InvalidOutboxMaxAttempts" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :+: C1 ('MetaCons "InvalidOutboxPublishingTimeout" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)))) :+: ((C1 ('MetaCons "InvalidConstantBackoff" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime)) :+: C1 ('MetaCons "InvalidExponentialBackoffInitial" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime))) :+: (C1 ('MetaCons "InvalidExponentialBackoffMultiplier" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Double)) :+: C1 ('MetaCons "InvalidExponentialBackoffMaxDelay" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime))))) | |||||
data OutboxPublishSummary Source #
Aggregate result of one publisher pass.
published + retried + dead equals the number of rows claimed. retried
includes rows that were skipped because an earlier row in the same ordered
publish group failed; those rows are returned to failed without consuming
an attempt. haltedOn is populated only by StopTheLine policy and names
the failed pivot row, which is already counted in retried or dead.
Constructors
| OutboxPublishSummary | |
Instances
| Generic OutboxPublishSummary Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OutboxPublishSummary -> Rep OutboxPublishSummary x # to :: Rep OutboxPublishSummary x -> OutboxPublishSummary # | |||||
| Show OutboxPublishSummary Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OutboxPublishSummary -> ShowS # show :: OutboxPublishSummary -> String # showList :: [OutboxPublishSummary] -> ShowS # | |||||
| Eq OutboxPublishSummary Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OutboxPublishSummary -> OutboxPublishSummary -> Bool # (/=) :: OutboxPublishSummary -> OutboxPublishSummary -> Bool # | |||||
| type Rep OutboxPublishSummary Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxPublishSummary = D1 ('MetaData "OutboxPublishSummary" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxPublishSummary" 'PrefixI 'True) ((S1 ('MetaSel ('Just "claimed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "published") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "retried") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "dead") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "haltedOn") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe OutboxId)))))) | |||||
data OutboxMaintenanceOptions Source #
Knobs for outboxMaintenancePass.
Schedule maintenance less frequently than publish passes; it owns crash reclamation and backlog gauge sampling.
Constructors
| OutboxMaintenanceOptions | |
Fields | |
Instances
| Generic OutboxMaintenanceOptions Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OutboxMaintenanceOptions -> Rep OutboxMaintenanceOptions x # to :: Rep OutboxMaintenanceOptions x -> OutboxMaintenanceOptions # | |||||
| Show OutboxMaintenanceOptions Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OutboxMaintenanceOptions -> ShowS # show :: OutboxMaintenanceOptions -> String # showList :: [OutboxMaintenanceOptions] -> ShowS # | |||||
| Eq OutboxMaintenanceOptions Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OutboxMaintenanceOptions -> OutboxMaintenanceOptions -> Bool # (/=) :: OutboxMaintenanceOptions -> OutboxMaintenanceOptions -> Bool # | |||||
| type Rep OutboxMaintenanceOptions Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxMaintenanceOptions = D1 ('MetaData "OutboxMaintenanceOptions" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxMaintenanceOptions" 'PrefixI 'True) (S1 ('MetaSel ('Just "maxAttempts") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "publishingTimeout") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NominalDiffTime))) | |||||
data OutboxMaintenanceSummary Source #
Result of one outbox maintenance pass.
Constructors
| OutboxMaintenanceSummary | |
Instances
| Generic OutboxMaintenanceSummary Source # | |||||
Defined in Keiro.Outbox.Types Associated Types
Methods from :: OutboxMaintenanceSummary -> Rep OutboxMaintenanceSummary x # to :: Rep OutboxMaintenanceSummary x -> OutboxMaintenanceSummary # | |||||
| Show OutboxMaintenanceSummary Source # | |||||
Defined in Keiro.Outbox.Types Methods showsPrec :: Int -> OutboxMaintenanceSummary -> ShowS # show :: OutboxMaintenanceSummary -> String # showList :: [OutboxMaintenanceSummary] -> ShowS # | |||||
| Eq OutboxMaintenanceSummary Source # | |||||
Defined in Keiro.Outbox.Types Methods (==) :: OutboxMaintenanceSummary -> OutboxMaintenanceSummary -> Bool # (/=) :: OutboxMaintenanceSummary -> OutboxMaintenanceSummary -> Bool # | |||||
| type Rep OutboxMaintenanceSummary Source # | |||||
Defined in Keiro.Outbox.Types type Rep OutboxMaintenanceSummary = D1 ('MetaData "OutboxMaintenanceSummary" "Keiro.Outbox.Types" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "OutboxMaintenanceSummary" 'PrefixI 'True) (S1 ('MetaSel ('Just "requeued") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "deadLettered") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "backlog") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))) | |||||
defaultPublishOptions :: OutboxPublishOptions Source #
Sensible defaults: batch of 32, ten retry attempts, two-second constant backoff, per-key head-of-line ordering.
defaultMaintenanceOptions :: OutboxMaintenanceOptions Source #
Maintenance defaults match the publisher's retry ceiling and stale-row timeout.
mkOutboxPublishOptions :: OutboxPublishOptions -> Either OutboxPublishConfigError OutboxPublishOptions Source #
Validate outbox publisher options before starting a worker.
statusText :: OutboxStatus -> Text Source #
Wire representation of OutboxStatus used in the status column.
parseStatus :: Text -> Either Text OutboxStatus Source #
Inverse of statusText. Unknown database values are decode failures.
nextDelay :: BackoffSchedule -> Int -> NominalDiffTime Source #
Compute the retry delay for an attempt number (1-based: 1 = first
failure, 2 = second failure, …). Used by markOutboxFailedTx
to derive next_attempt_at.