Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Specification
Specification
Functions
Schemas
Registers

ReplayBatch

Source schemas/json/replay-batch.schema.json

On this page
  1. Properties
  2. Positive fixtures
  3. Negative fixtures
  4. Schema

Node store-and-forward replay batch for reconnect catch-up. batchId MUST be retry-stable for the same durable ordered event cut. Event identities MUST NOT be rewritten by attempt/replay metadata.

FieldValue
Identifierurn:obsp:schema:v3.1:replaybatch
Dialecthttps://json-schema.org/draft/2020-12/schema
Used by functionsObserve

Properties

PropertyRequiredTypeDescription
schemaVersionyesreference
claimyesstringBatch is a transport of Node-local durable facts; not Fleet or institutional authority.
batchIdyesstringRetry-stable identity for this ordered durable cut (deterministic digest or durable persisted id).
nodeUniyesreference
tenantUniyesreference
workspaceUniyesreference
firstSequencenointeger
lastSequencenointeger
attemptnointegerTransmission attempt counter; MUST NOT alter eventId or payloadDigest.
correlationIdnostring
eventsyesarray
extensionsnoreference

Positive fixtures

  • replay-batch.valid.json

Negative fixtures

  • replay-batch.missing-batch-id.json: required at /: 'batchId' is a required property

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:obsp:schema:v3.1:replaybatch",
  "title": "ReplayBatch",
  "description": "Node store-and-forward replay batch for reconnect catch-up. batchId MUST be retry-stable for the same durable ordered event cut. Event identities MUST NOT be rewritten by attempt/replay metadata.",
  "type": "object",
  "required": [
    "schemaVersion",
    "batchId",
    "nodeUni",
    "tenantUni",
    "workspaceUni",
    "events",
    "claim"
  ],
  "properties": {
    "schemaVersion": {
      "$ref": "#/$defs/SchemaVersion"
    },
    "claim": {
      "type": "string",
      "const": "REPLAY_BATCH_NOT_AUTHORITY",
      "description": "Batch is a transport of Node-local durable facts; not Fleet or institutional authority."
    },
    "batchId": {
      "type": "string",
      "minLength": 16,
      "maxLength": 256,
      "description": "Retry-stable identity for this ordered durable cut (deterministic digest or durable persisted id)."
    },
    "nodeUni": {
      "$ref": "#/$defs/Uni"
    },
    "tenantUni": {
      "$ref": "#/$defs/Uni"
    },
    "workspaceUni": {
      "$ref": "#/$defs/Uni"
    },
    "firstSequence": {
      "type": "integer",
      "minimum": 0
    },
    "lastSequence": {
      "type": "integer",
      "minimum": 0
    },
    "attempt": {
      "type": "integer",
      "minimum": 1,
      "description": "Transmission attempt counter; MUST NOT alter eventId or payloadDigest."
    },
    "correlationId": {
      "type": "string",
      "minLength": 8,
      "maxLength": 128
    },
    "events": {
      "type": "array",
      "minItems": 1,
      "maxItems": 256,
      "items": {
        "$ref": "#/$defs/ReplayEvent"
      }
    },
    "extensions": {
      "$ref": "#/$defs/Extensions"
    }
  },
  "additionalProperties": false,
  "$defs": {
    "SchemaVersion": {
      "type": "string",
      "const": "3.1.0"
    },
    "Uni": {
      "type": "string",
      "minLength": 8,
      "maxLength": 256,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9:._/@-]{7,255}$"
    },
    "Digest": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,31}:[A-Fa-f0-9]{32,128}$"
    },
    "IsoDateTime": {
      "type": "string",
      "format": "date-time"
    },
    "Extensions": {
      "type": "object",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
      },
      "additionalProperties": true
    },
    "ReplayEvent": {
      "type": "object",
      "required": [
        "eventId",
        "eventType",
        "schemaVersion",
        "payloadDigest",
        "payload",
        "recordedAt"
      ],
      "properties": {
        "eventId": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        },
        "eventType": {
          "type": "string",
          "pattern": "^observatory\\.[a-z0-9]+(\\.[a-z0-9]+){1,6}$"
        },
        "schemaVersion": {
          "$ref": "#/$defs/SchemaVersion"
        },
        "sequence": {
          "type": "integer",
          "minimum": 0
        },
        "correlationId": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        },
        "causationId": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128
        },
        "payloadDigest": {
          "$ref": "#/$defs/Digest"
        },
        "recordedAt": {
          "$ref": "#/$defs/IsoDateTime"
        },
        "payload": {
          "type": "object",
          "description": "For observed-state replay, payload is ObservedStateReceipt.",
          "additionalProperties": true
        }
      },
      "additionalProperties": false
    }
  }
}