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 first character of every parkedId: an id is never a bare hexadecimal number.

Link copied to clipboard
const val READ: String

The action a read of the parked entries is authorized as, on each entry's aggregate, as the commands above are: no command runs, since an entry is only read, but it shows its failure's message.

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_PARKED: String
Link copied to clipboard
const val SKIP_PARKED: 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: PARKED_ID_PREFIX and the first 128 bits of the SHA-256 of <service>:<context>:<subscription>:<aggregate context>.<aggregate>:<tenant>:<id>, in 32 lowercase hexadecimal digits, 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. Its length is 33 whatever the tenant and the id (#6626): the id of an aggregate that may exist, and a tenant the rules allow, always make an ops aggregate id that may exist too, and a path that carries it stays short. The entry's fields are in the entry, not in its id.

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.