Ledger

object Ledger

The failure ledger across services: each service keeps its own ledger, atomic with its checkpoints, and publishes its changes to the ops context, which aggregates them; an operator's action goes back to the owning service.

Their names sit in the system namespace NAMESPACE, as the lifecycle commands' do.

Properties

Link copied to clipboard
Link copied to clipboard

The ledger's system commands, by their names.

Link copied to clipboard
const val ENTRY: String

The member of RECORD_PARKED's body that holds its LedgerEntry.

Link copied to clipboard
Link copied to clipboard
const val NAMESPACE: String

The namespace of the ledger's system commands.

Link copied to clipboard
const val OPS_CONTEXT: String

The context a service publishes its ledger to unless it is configured otherwise.

Link copied to clipboard
const val PARKED: String

The aggregate of the ops context that records one parked entry of one service.

Link copied to clipboard

The simple names of the commands a service sends to PARKED: their full names are <ops>.parked.<name>.

Link copied to clipboard
Link copied to clipboard
const val RESOLUTION: String

The member of RECORD_RESOLVED's body that holds its LedgerResolution.

Link copied to clipboard
const val RETRY: String
Link copied to clipboard
const val SKIP: String

Functions

Link copied to clipboard
fun nameOf(type: Class<*>): String?

The system name of type, a ledger command, or null when it is none.

Link copied to clipboard
fun parkedId(service: String, context: String, subscription: String, ref: AggregateRef): String

The id of the ops aggregate recording the entry of ref that subscription, of context, parked in service: <service>:<context>:<subscription>:<aggregate context>.<aggregate>:<tenant>:<id>, so one service's entry of one aggregate is one ops aggregate, whichever node publishes it, and two contexts' subscriptions of one name keep entries of their own. Each field has its % and : percent-escaped (%25, %3A, Escapes), and the aggregate type's context its . too (Escapes.typeText), so two entries never share an id however their names join: tenant a:b with id c and tenant a with id b:c stay apart, as do context a.b's aggregate c and context a's b.c.

Link copied to clipboard
fun targetOf(context: String, parkedId: String): AggregateRef

Where a system command of the ledger on the entry parkedId names (Ledger.parkedId) is sent: the command topic of context, the context that holds the entry, keyed by the entry rather than by the parked aggregate, so a command on an entry of the context's own intake is not held behind the very aggregate it parked, and the commands of one entry keep their order.