| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Keiro.DeadLetter.Schema
Description
SQL storage for rejected process-manager and router dispatches.
The keiro.keiro_dead_letters table records a dispatched command that a
target state machine rejected. It is deliberately separate from Kiroku's
subscription dead-letter table: a row here describes one failed dispatch,
while the source subscription event is considered handled and may advance its
checkpoint.
Synopsis
- data DispatcherKind
- data DispatchDeadLetter = DispatchDeadLetter {
- dispatcherKind :: !DispatcherKind
- dispatcherName :: !Text
- correlationId :: !Text
- sourceEventId :: !EventId
- sourceGlobalPosition :: !GlobalPosition
- emitIndex :: !Int
- targetStreamName :: !StreamName
- errorClass :: !Text
- errorDetail :: !Text
- attemptCount :: !Int
- data DispatchDeadLetterRecord = DispatchDeadLetterRecord {
- deadLetterId :: !Int64
- dispatcherKind :: !DispatcherKind
- dispatcherName :: !Text
- correlationId :: !Text
- sourceEventId :: !EventId
- sourceGlobalPosition :: !GlobalPosition
- emitIndex :: !Int
- targetStreamName :: !StreamName
- errorClass :: !Text
- errorDetail :: !Text
- attemptCount :: !Int
- createdAt :: !UTCTime
- recordDispatchDeadLetterTx :: DispatchDeadLetter -> Transaction ()
- listDispatchDeadLettersTx :: Text -> Transaction [DispatchDeadLetterRecord]
Documentation
data DispatcherKind Source #
Which coordination primitive attempted the rejected dispatch.
Constructors
| DispatcherProcessManager | |
| DispatcherRouter |
Instances
data DispatchDeadLetter Source #
Fields persisted for one rejected dispatch.
Constructors
| DispatchDeadLetter | |
Fields
| |
Instances
| Generic DispatchDeadLetter Source # | |||||
Defined in Keiro.DeadLetter.Schema Associated Types
Methods from :: DispatchDeadLetter -> Rep DispatchDeadLetter x # to :: Rep DispatchDeadLetter x -> DispatchDeadLetter # | |||||
| Show DispatchDeadLetter Source # | |||||
Defined in Keiro.DeadLetter.Schema Methods showsPrec :: Int -> DispatchDeadLetter -> ShowS # show :: DispatchDeadLetter -> String # showList :: [DispatchDeadLetter] -> ShowS # | |||||
| Eq DispatchDeadLetter Source # | |||||
Defined in Keiro.DeadLetter.Schema Methods (==) :: DispatchDeadLetter -> DispatchDeadLetter -> Bool # (/=) :: DispatchDeadLetter -> DispatchDeadLetter -> Bool # | |||||
| type Rep DispatchDeadLetter Source # | |||||
Defined in Keiro.DeadLetter.Schema type Rep DispatchDeadLetter = D1 ('MetaData "DispatchDeadLetter" "Keiro.DeadLetter.Schema" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "DispatchDeadLetter" 'PrefixI 'True) (((S1 ('MetaSel ('Just "dispatcherKind") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DispatcherKind) :*: S1 ('MetaSel ('Just "dispatcherName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "correlationId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "sourceEventId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EventId) :*: S1 ('MetaSel ('Just "sourceGlobalPosition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobalPosition)))) :*: ((S1 ('MetaSel ('Just "emitIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "targetStreamName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StreamName)) :*: (S1 ('MetaSel ('Just "errorClass") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "errorDetail") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: S1 ('MetaSel ('Just "attemptCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int)))))) | |||||
data DispatchDeadLetterRecord Source #
A persisted rejected dispatch, including database-managed identity and time.
Constructors
| DispatchDeadLetterRecord | |
Fields
| |
Instances
| Generic DispatchDeadLetterRecord Source # | |||||
Defined in Keiro.DeadLetter.Schema Associated Types
Methods from :: DispatchDeadLetterRecord -> Rep DispatchDeadLetterRecord x # to :: Rep DispatchDeadLetterRecord x -> DispatchDeadLetterRecord # | |||||
| Show DispatchDeadLetterRecord Source # | |||||
Defined in Keiro.DeadLetter.Schema Methods showsPrec :: Int -> DispatchDeadLetterRecord -> ShowS # show :: DispatchDeadLetterRecord -> String # showList :: [DispatchDeadLetterRecord] -> ShowS # | |||||
| Eq DispatchDeadLetterRecord Source # | |||||
Defined in Keiro.DeadLetter.Schema Methods (==) :: DispatchDeadLetterRecord -> DispatchDeadLetterRecord -> Bool # (/=) :: DispatchDeadLetterRecord -> DispatchDeadLetterRecord -> Bool # | |||||
| type Rep DispatchDeadLetterRecord Source # | |||||
Defined in Keiro.DeadLetter.Schema type Rep DispatchDeadLetterRecord = D1 ('MetaData "DispatchDeadLetterRecord" "Keiro.DeadLetter.Schema" "keiro-0.12.0.0-inplace" 'False) (C1 ('MetaCons "DispatchDeadLetterRecord" 'PrefixI 'True) (((S1 ('MetaSel ('Just "deadLetterId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int64) :*: (S1 ('MetaSel ('Just "dispatcherKind") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 DispatcherKind) :*: S1 ('MetaSel ('Just "dispatcherName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "correlationId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "sourceEventId") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 EventId) :*: S1 ('MetaSel ('Just "sourceGlobalPosition") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 GlobalPosition)))) :*: ((S1 ('MetaSel ('Just "emitIndex") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: (S1 ('MetaSel ('Just "targetStreamName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 StreamName) :*: S1 ('MetaSel ('Just "errorClass") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text))) :*: (S1 ('MetaSel ('Just "errorDetail") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Text) :*: (S1 ('MetaSel ('Just "attemptCount") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Int) :*: S1 ('MetaSel ('Just "createdAt") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 UTCTime)))))) | |||||
recordDispatchDeadLetterTx :: DispatchDeadLetter -> Transaction () Source #
Insert a rejected dispatch inside the caller's transaction. Redelivery is
idempotent: a duplicate (dispatcher_name, source_event_id, emit_index) is a
no-op. Error detail is bounded here so every caller gets the same 1024-character
storage contract.
listDispatchDeadLettersTx :: Text -> Transaction [DispatchDeadLetterRecord] Source #
List one dispatcher's records, newest first.