Transport and topology
Connection and rights
Section titled “Connection and rights”Connect over AMQPS (AMQP 0-9-1 over TLS) to the host, port and virtual host supplied by FeedHub. Use the supplied client username and password, verify the server certificate and hostname, and keep credentials in your client configuration. Obtain the FeedHub instance name, sport and phase subscriptions, queue names, replica assignment, connection cap and any betting rights from the same handoff. The virtual host and the FeedHub instance are separate settings.
Provisioning creates the client’s queues, bindings and permissions. Consume from your assigned queues and publish requests to your instance’s granted request exchanges. Use the existing names and bindings. The client cannot consume FeedHub’s service queues or another client’s queues. Extra exchange or queue declarations and bindings are unnecessary for the operations below.
| Topology | Provisioned name and routing |
|---|---|
| Event snapshot and index | Topic exchange feedhub-event-snapshot-<instance>, routing key <sportId>.live or <sportId>.prematch |
| Market snapshot | Topic exchange feedhub-market-snapshot-<instance>, same routing key convention |
| Client snapshot queue | Durable queue <client>-feedhub-<instance>-snapshots, bound to both topic exchanges for each subscribed sport and phase |
| Client resync response exchange and queue | <client>-feedhub-<instance>-resync, fanout exchange with a same-name durable queue bound by "" |
| Client bet results exchange and queue | <client>-feedhub-<instance>-bet-results, fanout exchange with a same-name durable queue bound by "", available with betting rights |
| FeedHub request exchanges and queues | The table below gives the fanout exchange names. Each has a same-name durable service queue. Requests publish with routing key "". |
Replica 1 uses the unsuffixed names. For replicas 2 and above, provisioning appends -<replica> to both the snapshot queue and the resync exchange and queue, for example sample-client-feedhub-sandbox-resync-2. Each snapshot replica receives a copy for the same subscribed sport and phase keys. Use the matching resync destination for the requester. The bet results queue stays shared, with no replica suffix. Coordinate a single active settlement reader per client identity.
Sport IDs in topic keys use canonical UUID text with hyphens. Example routing key 01967fb0-0a00-7000-8000-000000000001.prematch selects one sport and the prematch phase. Snapshot queue length and message TTL are provisioned limits. The drop-head policy can discard older messages, and TTL can expire a backlog. Results queues use reject-publish on overflow and have no message TTL under the release’s provisioning policy. Control Plane provisioning sets their queue length to 100,000. Request queues can reject publishes when full. Use your provisioned values for operational bounds.
| Exchange | Request family | Reply destination |
|---|---|---|
feedhub-catalog-<instance> |
Active-event pages, reference pages and lookups, publication membership | Direct Reply-To |
feedhub-refresh-<instance> |
Pre-bet refresh | Direct Reply-To |
feedhub-resync-<instance> |
Event resync | Client replica’s fixed resync exchange |
feedhub-liveness-<instance> |
FeedHub liveness | Direct Reply-To |
feedhub-heartbeat-<instance> |
Edge heartbeat | Direct Reply-To |
feedhub-bets-<instance> |
Bet placement | Direct Reply-To, betting capability required |
feedhub-settlements-<instance> |
Bet status | Direct Reply-To, betting capability required |
Envelope and properties
Section titled “Envelope and properties”FeedHub uses a UTF-8 JSON transport envelope with AMQP basic content-type set to application/vnd.masstransit+json. Within it, messageType is an array of type URN strings and message is the JSON object defined for the operation. Match on the exact concrete URN. The derived feed message types also list urn:message:FeedHub.Contracts:FeedMessage, which has no exchange or standalone delivery of its own.
| Layer | Fields and interpretation |
|---|---|
| AMQP publish parameters | Exchange, routing key and optional mandatory are arguments to basic.publish. An AMQP delivery’s routing key and delivery tag arrive in its delivery metadata. |
| AMQP basic properties | content-type, delivery-mode, message-id, correlation-id, user-id, reply-to and expiration are independent of the JSON body. When set, expiration is a string containing a nonnegative number of milliseconds. delivery-mode: 2 requests persistence. |
AMQP header table and JSON headers |
FeedHub application headers belong in the envelope headers object. The transport also mirrors many values into the AMQP header table. A true FeedHub publication flag is JSON true in the envelope and the string True in the mirrored table. Use the envelope for FeedHub application data. |
| JSON envelope addressing | requestId is the request/reply UUID. responseAddress and optional faultAddress are endpoint URI strings. destinationAddress and sourceAddress are optional transport metadata. |
| JSON envelope metadata | messageId is an optional transport UUID. When the sender sets both it and AMQP message-id, they normally carry the same UUID text. correlationId, when present, is separately mirrored to basic correlation-id by the transport. sentTime and expirationTime, when present, are UTC timestamp strings. expirationTime gives responders an absolute expiry, while AMQP expiration bounds time in the queue. Other optional metadata includes conversationId, initiatorId (UUIDs) and host (an object). |
| FeedHub payload | message.schemaVersion is the integer payload version. For derived feed types, message.messageId is a distinct logical message UUID and message.producedAt is when FeedHub or the requester produced that payload. |
Use camelCase payload fields, with JSON booleans, numbers and strings as specified below. Canonical UUIDs are lowercase hyphenated JSON strings. FeedHub generates UUIDv7 for canonical entity IDs. Times are UTC ISO 8601 strings ending in Z unless documented otherwise. Use exact base-10 strings such as "1.45" for value, line, price, stake and currentPrice. Use a period as the decimal separator and omit grouping separators. Fields are required and non-null unless marked optional or given a default. FeedHub can send explicit null for nullable properties. A sender can omit an optional nullable field or use JSON null. Fields with non-null defaults use those defaults when omitted. Use current timestamps when sending a live request copied from an example.
Direct Reply-To
Section titled “Direct Reply-To”- Start
basic.consumeonamq.rabbitmq.reply-towithno-ack: true(automatic acknowledgement). Use this same AMQP connection and channel for publishing requests. The pseudo-queue is provided by RabbitMQ. - Publish to the operation’s named exchange with routing key
"". Set AMQPreply-totoamq.rabbitmq.reply-toand JSONresponseAddressto the endpoint’s RabbitMQ transport URI. Generate a unique JSONrequestIdfor each attempt. LeavefaultAddressabsent to send request faults to the same response destination. - Set AMQP
user-idto your authenticated username for catalog, refresh, heartbeat, placement and status requests. RabbitMQ verifies a supplieduser-idagainst the connection identity. Liveness does not need that stamp. Direct replies do not requireuser-idfrom the FeedHub responder. - Use a finite local deadline and set AMQP
expirationto the request’s time to live in milliseconds. When supplyingexpirationTimein the envelope, use the corresponding absolute UTC expiry. Bet placement uses a shorter queue TTL than the local wait for a reply. Assign a newrequestIdon a retry and follow the operation’s recovery rules. - RabbitMQ rewrites
reply-towhen delivering the request to FeedHub. The responder publishes through the default exchange ("") using RabbitMQ’s opaqueamq.rabbitmq.reply-to.<suffix>routing key. Match the echoed JSONrequestIdand expected reply or typed fault URN against a pending call. AMQPcorrelation-idalone does not satisfy envelope correlation. Ignore unrelated or expired responses. An unreadable or unsupported reply leaves the outcome unconfirmed.
For virtual host /, the illustrative response address is rabbitmq://broker.feedhub.example:5671/amq.rabbitmq.reply-to. With a named virtual host such as customer, the transport URI includes the vhost path segment before the endpoint. The corresponding TLS form is rabbitmqs://broker.feedhub.example:5671/customer/amq.rabbitmq.reply-to. Use the provisioned virtual host and URI-encode names where needed. Both rabbitmq:// and rabbitmqs:// forms are supported as transport endpoint addresses. Configure AMQPS and certificate verification on the actual client connection.
Replies may be lost during disconnect or a channel restart. Recreate the Direct Reply-To consumer before resuming requests. RabbitMQ does not buffer these replies for later consumption. RabbitMQ Direct Reply-To
Example request properties
Section titled “Example request properties”For the illustrated sample-client publishing a catalog or other stamped Direct Reply-To request, reuse this frame and substitute the operation’s exchange, type and payload. Liveness uses the frame without user-id.
basic.publish exchange=feedhub-catalog-sandbox routing-key="" mandatory=truecontent-type: application/vnd.masstransit+jsondelivery-mode: 2reply-to: amq.rabbitmq.reply-touser-id: sample-clientexpiration: 10000The sample expiry is ten seconds and is encoded as a string. The JSON body examples show the envelope for each request family.
Fixed resync replies
Section titled “Fixed resync replies”Start consuming your replica’s provisioned resync queue with manual acknowledgements before sending requests. Set JSON responseAddress and faultAddress to the same replica’s resync exchange URI, for example rabbitmq://broker.feedhub.example:5671/sample-client-feedhub-sandbox-resync-2. Publish to feedhub-resync-sandbox with routing key "". The asynchronous request does not require an AMQP reply-to, an envelope requestId, or the Direct Reply-To request expiry. FeedHub publishes replies or faults to the named resync exchange, normally with routing key "". See event resync for matching and applying those deliveries.
Confirms and acknowledgements
Section titled “Confirms and acknowledgements”Use publisher confirms and observe basic.return for mandatory request publishes. A positive confirm can accompany a returned, unroutable publication. A channel error, return, negative confirm or deadline expiry gives the client no confirmed business outcome. A broker-confirmed, routed request still needs its operation’s business reply when one is expected. A consumer confirms successful handling with basic.ack on the delivery’s channel and delivery tag. A channel or connection failure can cause unacknowledged durable queue deliveries to be sent again. RabbitMQ publisher confirms and acknowledgements
Schema versions and typed faults
Section titled “Schema versions and typed faults”Send schema version 1 for all documented payloads. Ignore unrecognized additive fields and preserve the distinction between a missing field and an explicit empty array where the operation defines one. Release compatibility also depends on the documented fields and behavior. Match the reference to the FeedHub deployment in use. The enum fields in this reference are open. FeedHub writes string names. Treat unrecognized names or out-of-range numeric enum values as Unrecognized and follow the operation’s fallback. A value of another JSON type is malformed. Edge 1.0.0 and the heartbeat’s edgeVersion identify the software release separately from any payload schemaVersion.
Several responders signal rejected requests with a typed fault. When the request can be bound to a known concrete type and the reply can be routed, the envelope may carry the corresponding exact fault URN with urn:message:MassTransit:Fault as an additional type. The fault body has faultId (UUID), optional faultedMessageId (transport UUID), timestamp (UTC timestamp), exceptions (array), host (object) and faultMessageTypes (string array), plus message containing the original request payload. Exception objects carry exceptionType and message strings, with diagnostic metadata such as stackTrace, source, data and optional innerException. Use the typed identity and echoed request data for recovery. Diagnostic text may vary.
Construct concrete fault URNs by placing the concrete request type identity inside urn:message:MassTransit:Fault[[…]]. For example urn:message:MassTransit:Fault[[FeedHub.Contracts:EventResyncRequest]] and urn:message:MassTransit:Fault[[FeedHub.Contracts:ReferenceByIdRequest[[FeedHub.Contracts:Sport]]]]. The catalog reference lists all concrete request type identities. The two successive pairs of closing brackets in the generic example close the record type and the fault type. A message with no recognizable type, malformed JSON or missing reply metadata may yield no usable reply. Bound local waits even when a fault is expected.