Skip to content

Resync, liveness and heartbeat

Publish urn:message:FeedHub.Contracts:EventResyncRequest to feedhub-resync-<instance> with routing key "". FeedHub replies with urn:message:FeedHub.Contracts:EventResyncResponse or urn:message:MassTransit:Fault[[FeedHub.Contracts:EventResyncRequest]] to the fixed resync destination of the requesting replica. Consume from the corresponding queue with manual acknowledgement. Use that replica’s URI for both envelope responseAddress and faultAddress. The request and normal response include the three common feed fields.

Request field Type and use
eventId UUIDv7 in the standard UUID variant.
reason Open enum string. HashMismatch repairs known stale or mismatched state, ColdEvent recovers missing or withdrawn event state, and Placement asks for placement freshness. Clients normally use the batched refresh operation for pre-bet work.
requestedAt UTC timestamp of the request. Retain it to recognize a typed fault for this request.
marketIds Optional UUIDv7 array. Omit or send null for the whole event. If present, supply at least one ID. A market group carrying a requested market may include siblings that were not requested.
refFetchedAt Optional UTC timestamp of the held event snapshot used for a HashMismatch check.

FeedHub drops a request with no envelope response address. FeedHub faults a version above 1, an unrecognized reason including Unrecognized, an invalid event or market UUIDv7, or an explicit empty market ID array. An optional envelope expirationTime supplies an absolute deadline that FeedHub uses to bound some upstream waits. Edge’s regular asynchronous resync sender leaves it out. Apply a local deadline independently and expect late replies.

Example fixed-queue request for replica 2. Consume sample-client-feedhub-sandbox-resync-2 with manual acknowledgement first.

basic.publish exchange=feedhub-resync-sandbox routing-key="" mandatory=true
content-type: application/vnd.masstransit+json
delivery-mode: 2
{
"messageId": "01967fb0-0a00-7000-8000-000000000201",
"responseAddress": "rabbitmq://broker.feedhub.example:5671/sample-client-feedhub-sandbox-resync-2",
"faultAddress": "rabbitmq://broker.feedhub.example:5671/sample-client-feedhub-sandbox-resync-2",
"messageType": [
"urn:message:FeedHub.Contracts:EventResyncRequest",
"urn:message:FeedHub.Contracts:FeedMessage"
],
"message": {
"schemaVersion": 1,
"messageId": "01967fb0-0a00-7000-8000-000000000211",
"producedAt": "2026-11-30T10:02:30Z",
"eventId": "01967fb0-0a00-7000-8000-000000000002",
"reason": "HashMismatch",
"requestedAt": "2026-11-30T10:02:30Z",
"marketIds": ["01967fb0-0a00-7000-8000-000000000003"],
"refFetchedAt": "2026-11-30T10:00:00Z"
}
}

The response contains eventId (UUID), status (open enum), optional event (event snapshot) and markets (array of market snapshots, defaults to an empty array). FeedHub sends returned market snapshots with full: true.

Status Effect on held state
Served Check version, scope and, in a managed deployment, publication eligibility. Apply the event before the markets using ordinary feed freshness checks. A finished event can arrive as a terminal snapshot with no markets. A late served response can improve state if its payload is still newer.
Unknown No available or eligible snapshot. Preserve held state and complete the outstanding attempt as unserved. When the reply carries feedhub-publication-hidden: true, check publication membership to determine whether to hide affected held state.
Failed FeedHub could not read or refresh what it needed. Preserve held state and complete the attempt as unserved.
Unrecognized Complete the attempt as unserved and leave held state intact.

For a normal resync reply, select held state by payload eventId. Once Edge admits the reply to feed state processing, it ends the outstanding request window for that event even if a previous request produced the reply. Edge ignores replies with event content outside its subscribed scope. It also handles a managed hidden reply through membership revalidation and leaves the request window to expire. Enforce freshness even on a reply that arrives after a request timed out or after restart. For a typed fault, the fault payload’s nested message is the original resync request. Edge ends the matching outstanding attempt after comparing its eventId, requestedAt at microsecond precision, and refFetchedAt. A stale or unrelated fault leaves a newer attempt pending. A typed fault can embed a request with the rejected schema version.

Keep a single in-flight repair per event with a finite timeout. Edge backs off specific market hashes when a sent HashMismatch request ends unserved or times out. A changed manifest hash or a served reply carrying the market clears that backoff. A failed publish releases the request without consuming a backoff step, and a ColdEvent can be asked again after its unserved attempt ends. Delay hash-driven repair while catching up from a delivery backlog. After any state effects commit, acknowledge the handled response or fault on the receiving channel. This also applies to stale deliveries. Use the feed error policy for unreadable deliveries.

Example Unknown reply published to sample-client-feedhub-sandbox-resync-2 with routing key "", content-type: application/vnd.masstransit+json and persistent delivery. Managed replies may carry the publication headers described in feed deliveries.

{
"messageType": [
"urn:message:FeedHub.Contracts:EventResyncResponse",
"urn:message:FeedHub.Contracts:FeedMessage"
],
"message": {
"schemaVersion": 1,
"messageId": "01967fb0-0a00-7000-8000-000000000212",
"producedAt": "2026-11-30T10:02:30.5Z",
"eventId": "01967fb0-0a00-7000-8000-000000000002",
"status": "Unknown",
"event": null,
"markets": []
}
}

Publish urn:message:FeedHub.Contracts:FeedHubLivenessRequest to feedhub-liveness-<instance> with routing key "". The reply URN is urn:message:FeedHub.Contracts:FeedHubLivenessResponse. The fault URN is urn:message:MassTransit:Fault[[FeedHub.Contracts:FeedHubLivenessRequest]]. Use Direct Reply-To with a bounded timeout and AMQP expiry. Liveness does not require the AMQP user-id stamp. The request payload has schemaVersion (integer 1) and requestedAt (UTC timestamp).

Reply field Type and use
schemaVersion Integer 1.
instance String naming the FeedHub instance.
status Open enum string. Fresh means FeedHub obtained a fresh poller heartbeat, Missing means the heartbeat is absent, and Stale means a stored heartbeat is too old or lacks its update time.
readAt UTC timestamp according to the FeedHub clock when it read heartbeat state.
lastPollAtLive, lastPollAtPreMatch Optional UTC timestamps of the last successful completed poll for each phase.
lagLive, lagPreMatch Optional duration strings for observed live and prematch poll lag. Format is [-][d.]hh:mm:ss[.fffffff], for example "00:00:00.2500000".
lagWindowAt Optional UTC timestamp associated with the poll lag reporting window.
gateClosedUntil Optional UTC timestamp through which FeedHub’s SportAPI polling gate is closed. Null means no gate time was reported.
updatedAt Optional timestamp of the poller heartbeat update.

A Missing or Stale reply supplies the instance, status and read time. No reply, a fault, malformed data or Unrecognized status leaves poller health unknown to a direct client. A Redis heartbeat lookup failure leaves this request unanswered. The release responder accepts an above-version request if the payload binds. Send version 1 and check the reply version before interpreting it.

The poll timestamps, reported poll lag and gate time describe FeedHub. Edge uses readAt to align its estimate of FeedHub time. For readiness, Edge combines the liveness status with its own bootstrap, recent delivery lag, and arrival of snapshots when it holds an active event and FeedHub recently polled. The reported poll lag and gate time are informational for Edge 1.0.0. This release uses a bindable liveness reply directly without a separate version check. Its defaults are one probe every five seconds with a three-second deadline.

Example request to feedhub-liveness-sandbox, with the Direct Reply-To properties except user-id.

{
"requestId": "01967fb0-0a00-7000-8000-000000000202",
"responseAddress": "rabbitmq://broker.feedhub.example:5671/amq.rabbitmq.reply-to",
"messageType": ["urn:message:FeedHub.Contracts:FeedHubLivenessRequest"],
"message": {
"schemaVersion": 1,
"requestedAt": "2026-11-30T10:02:30Z"
}
}
{
"requestId": "01967fb0-0a00-7000-8000-000000000202",
"messageType": ["urn:message:FeedHub.Contracts:FeedHubLivenessResponse"],
"message": {
"schemaVersion": 1,
"instance": "sandbox",
"status": "Fresh",
"readAt": "2026-11-30T10:02:30.2Z",
"lastPollAtLive": "2026-11-30T10:02:29Z",
"lastPollAtPreMatch": "2026-11-30T10:02:25Z",
"lagLive": "00:00:00.2500000",
"lagPreMatch": "00:00:01",
"lagWindowAt": "2026-11-30T10:02:00Z",
"gateClosedUntil": null,
"updatedAt": "2026-11-30T10:02:30Z"
}
}

Publish urn:message:FeedHub.Contracts:EdgeHeartbeat to feedhub-heartbeat-<instance> with routing key "" and the Direct Reply-To properties, including your client identity. Replies use urn:message:FeedHub.Contracts:EdgeHeartbeatReply. The request reports the running instance’s local state to FeedHub. It is separate from the liveness probe.

Request field Type and use
schemaVersion Integer 1.
edgeId UUID identifying this process instance. Edge creates a UUIDv7 on start and reuses it for that run.
edgeVersion String identifying the reported Edge image release, for example "1.0.0".
startedAt, sentAt UTC timestamps for process start and report creation.
status Open enum string, Ready or Degraded.
reason Optional open enum string. Known reasons are Starting, Liveness, LiveLag, Arrival and QueueLag.
lagSeconds Optional JSON number reporting lag in seconds.
lastFetchedAt Optional UTC timestamp for the latest known fetched event state.
events, markets, referenceRecords, subscribers Integer counters for held state and active subscribers. Use integers in the signed 64-bit range.

A reply carries schemaVersion (integer 1), version (string echoing edgeVersion), and verdict (open enum string).

Verdict Meaning and Edge 1.0.0 behavior
Allowed The version is allowed. Edge continues.
Deprecated The version runs but is marked for removal. Edge warns and continues.
Disabled FeedHub disabled that version. Edge marks startup or operation failed and stops.
Unlisted The version is absent from policy or has invalid version syntax. Edge continues.
Unrecognized Edge continues without a known policy verdict.

FeedHub drops a heartbeat without a response address. An above-version request or failed version policy lookup can fault with urn:message:MassTransit:Fault[[FeedHub.Contracts:EdgeHeartbeat]]. A fault or timeout leaves this report unconfirmed. Edge retains its previously observed verdict and continues sending at its configured interval if it is still running. Edge defaults to a 30-second interval and a five-second timeout, with one call outstanding at a time. A direct client should also check the reply’s schema version and version against what it sent. Edge 1.0.0 applies the verdict from a bindable, correlated reply without those additional checks.

Example request on feedhub-heartbeat-sandbox. Set expiration to 5000 for the five-second example timeout.

{
"requestId": "01967fb0-0a00-7000-8000-000000000203",
"responseAddress": "rabbitmq://broker.feedhub.example:5671/amq.rabbitmq.reply-to",
"messageType": ["urn:message:FeedHub.Contracts:EdgeHeartbeat"],
"message": {
"schemaVersion": 1,
"edgeId": "01967fb0-0a00-7000-8000-000000000220",
"edgeVersion": "1.0.0",
"startedAt": "2026-11-30T10:00:00Z",
"sentAt": "2026-11-30T10:02:30Z",
"status": "Ready",
"reason": null,
"lagSeconds": 0.25,
"lastFetchedAt": "2026-11-30T10:02:29Z",
"events": 15,
"markets": 150,
"referenceRecords": 45,
"subscribers": 1
}
}
{
"requestId": "01967fb0-0a00-7000-8000-000000000203",
"messageType": ["urn:message:FeedHub.Contracts:EdgeHeartbeatReply"],
"message": {
"schemaVersion": 1,
"version": "1.0.0",
"verdict": "Allowed"
}
}