The adapter subjects
Table of Contents
1. Summary
Adapter traffic uses one subject family under marketdata.v1. Ticks arrive on
marketdata.v1.ingress.<adapter>.<id token>. Control messages use
marketdata.v1.adapters.*. After the service stores a tick it delivers it on
the per-party stream marketdata.v1.ops.market_tick.<tenant>.<party>.<token>.
No subject contains the word synthetic or any other mark of the source kind.
2. Detail
2.1. The ingress subject
The service subscribes once to marketdata.v1.ingress.>. The <adapter> token
is the opaque adapter id, for example bloomberg-sim. Code never parses the
token to learn what the adapter is. The registered source says that.
2.2. The two families the ingest consumes
The loop also subscribes to synthetic.v1.ops.tick.>, the subject a producer
publishes on when its quote serves no adapter. Both families are one fact held
in the market data API: ingest_subject_wildcards() returns them, the loop
subscribes to what it returns, and ingest_consumes() answers whether a
subject is one of them. A synthetic feed that a person starts by hand publishes
through the adapter of its provider, not through the producer subject, because
only a source and a route make the ingest store a tick.
2.3. The token rule
A vendor id can hold characters that NATS does not allow in a token: a RIC such
as EUR= holds an equals sign, and a Bloomberg ticker such as
EURUSD Curncy holds a space. The builder percent-encodes every byte outside
letters, digits, hyphen and underscore, so the token holds no dot, space or
wildcard. The tick payload carries the exact id, so nothing depends on
decoding the token.
2.4. The control subjects
Announce, demand and heartbeat are in An adapter and the service meet at four messages. They are the only subjects an adapter publishes or answers besides ingress.
2.5. The party stream
market_tick_subject(tenant, party, oresmd_uri) builds the subject that a party
reads. The token is the canonical oresmd URI as one token. A party reads all its
data with a wildcard that ends in .>. The payload is described in The market tick.
3. See also
- Market Data Architecture — the structure note that orders this cluster.
- An adapter and the service meet at four messages — completes: the messages these subjects carry.
- The market tick — completes: the payload of the party stream.