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: Learn
Start
Guides
Domain packs
Participants
Security and privacy
Pilot kits
Operations
Ecosystem

Guide: the exchange plane (reference implementation)

Source docs/guides/exchange.md

On this page
  1. One model, every binding, corrections everywhere
  2. Paths
  3. Usage policies
  4. Running it
  5. Webhooks
  6. Test results recorded
  7. Known gaps

The reference crate reference/rust/obsp-exchange serves the exchange plane (specification 5.9 Correct and 5.10 Exchange). The reference gateway mounts it at its root (feature exchange, on by default). It implements the DRAFT proposals OIP-0001 (read APIs), OIP-0005 (CAP alerts), OIP-0009 (WIS 2.0, STAC obsp extension, OGC API Features, EDR and Records) and OIP-0024 (CloudEvents, gRPC, SensorThings). None of them is accepted, so nothing here is a protocol contract, and passing the tests below is a recorded result, not a claim that the implementation conforms to any of the standards it follows.

One model, every binding, corrections everywhere

The seed (--exchange-seed, example reference/rust/obsp-gateway/examples/exchange-seed.json) holds products (ProductManifest with the OIP-0001 members), the versions of their observation records, correction notices, systems and sensors, and alert notices. Every document is checked at start: manifests, records and notices against their schemas, notices against the transition table of 5.9 (a notice from a state the version is not in is refused).

A version’s correction state starts CURRENT and follows its notices. Nothing is removed. In every binding:

Binding How a superseded, withdrawn or recalled value is shown
OGC API Features every version is an item; the latest has the record UNI as id, an earlier one uni@version; obsp:correctionState, obsp:supersededBy, links successor-version, predecessor-version, latest-version; obsp:latest=true keeps latest versions only
OGC API EDR (CoverageJSON) ranges carry the current value (the successor’s value; null for a withdrawn one); obsp:corrections lists every non-current version with a link to its item; obsp:history=true adds them as flagged coverages
OGC API Records a superseded product keeps its record, with its state and a successor-version link
SensorThings 1.1 one Observation per version (uni@version); parameters carries the correction members and obsp:links to the successor Observation
STAC obsp:correction_state, obsp:superseded_by, successor-version and predecessor-version links; obsp:corrected_records counts non-current values
WIS 2.0 a notice is announced like a record, with an update link to the successor or a deletion link to a withdrawn value; a withdrawn value is never announced as data
CAP 1.2 obsp-evidence-state parameter when a record named as evidence is no longer current
CloudEvents, webhooks, SSE, WebSocket, MQTT, gRPC obsp.correction.issued events with obspcorrectionstate and obspsupersededby; every channel replays from a cursor, so each correction arrives at least once

Paths

Standard (edition) Paths
OGC API - Common Parts 1 and 2; Features Part 1 (core, GeoJSON, OpenAPI), Part 2 (CRS84, EPSG:4326, EPSG:3857), Part 3 (queryables, CQL2 text and JSON filters); sortables /, /conformance, /api, /collections, /collections/{id}, /items, /items/{itemId}, /queryables, /sortables
OGC API - EDR 1.1 /collections/{id}/position, area, radius, trajectory, cube, locations[/{locId}]
OGC API - Records - Part 1 /collections/catalogue/... (one record per manifest), /collections/systems/... (stations and sensors)
OGC SensorThings API 1.1, read /sta/v1.1/... with $filter, $expand, $select, $orderby, $top, $skip, $count; MQTT topics v1.1/Datastreams('<id>')/Observations, v1.1/Observations
STAC API 1.0 (core, collections, ogcapi-features, item-search, filter, sort), STAC 1.1.0 documents /stac/..., /stac/search (GET and POST)
WIS 2.0 notification message MQTT origin/a/wis2/<centre-id>/data/<core|recommended>/weather/surface-based-observations; inspection at /wis2/notifications
CAP 1.2 /cap/alerts.atom, /cap/alerts/{noticeUni}
CloudEvents 1.0.2 /events (batch after a cursor); MQTT obsp/v1/<centre-id>/events/<productId>
Streams and subscriptions /events/stream (SSE, Last-Event-ID), /events/ws (WebSocket), /subscriptions (signed webhooks)
gRPC service obsp.v1.Exchange (reference/rust/obsp-exchange/proto/obsp/v1/exchange.proto), --grpc-listen

The OpenAPI 3.1 document of all HTTP paths is schemas/openapi/obsp-exchange-plane.openapi.yaml, served at /api. It is separate from the obsp-exchange.openapi.yaml that draft OIP-0009 would add.

Every route is read-only toward sites (EXCH-3): writes are refused with 405 and an Allow header. STAC POST search reads a body and changes nothing; the subscription routes change delivery state only.

Usage policies

When the gateway enforces usage policies (--policy-dir, feature policy, draft OIP-0014), every observation record passes the policy decision before any binding serves it: a withheld record leaves every list, coverage, catalogue, event batch and notification list and answers the policy refusal when asked for alone; a coarsened record is served coarsened. Webhook subscriptions are refused (403) and the SSE and WebSocket streams are not mounted, because they would deliver records after the per-request decision; the MQTT publisher and the gRPC service are operator channels and are not gated, so an operator who enforces policies does not start them for consumers.

Running it

cd reference/rust
cargo run -p obsp-gateway -- --root ../.. --listen 127.0.0.1:8080 \
    --exchange-seed obsp-gateway/examples/exchange-seed.json \
    --mqtt-broker 127.0.0.1:1883 --grpc-listen 127.0.0.1:8081

The compose stack (infra/compose) runs a local test broker (service mqtt) on the edge network and starts the gateway with --mqtt-broker mqtt:1883 --grpc-listen 0.0.0.0:8081.

Webhooks

POST /subscriptions with {"callback": "http://receiver/hook", "products": [...], "types": [...], "cursor": 0} answers 201 with a signing secret (whsec_<base64>), shown once. Each delivery is a structured CloudEvent with webhook-id, webhook-timestamp and webhook-signature: v1,<base64 HMAC-SHA256 of "id.timestamp.body"> (the Standard Webhooks layout), plus obsp-sequence and obsp-attempt. A receiver checks the signature, rejects old timestamps, and treats webhook-id as an idempotency key, because a delivery can repeat. Failed deliveries are retried with exponential backoff (6 attempts by default) and then dead-lettered; POST /subscriptions/{id}/replay with {"cursor": n} delivers everything after n again. Callbacks are http:// only: TLS to the receiver is the job of an egress proxy the operator runs.

Test results recorded

make rust runs them: 112 tests in obsp-exchange (unit tests in the modules included) and 7 in the gateway. The test names carry the abstract test (Annex A) or conformance class each one reflects.

Area Where Result
Features Parts 1 to 3, Records, read-only, problems obsp-exchange/tests/ogcapi.rs 14 pass
CQL2 text and JSON (12 classes; spatial-functions not declared) obsp-exchange/src/cql2.rs unit tests 23 pass
EDR 1.1 and CoverageJSON obsp-exchange/tests/edr.rs 18 pass
SensorThings 1.1 read and MQTT topics obsp-exchange/tests/sta.rs 24 pass
STAC API and the obsp extension obsp-exchange/tests/stac.rs 4 pass
WIS 2.0, CAP (equal to the draft binding’s positive example), CloudEvents, live corrections obsp-exchange/tests/notify.rs 6 pass
Webhooks, SSE, WebSocket, MQTT 5 at QoS 1 with a dropped connection obsp-exchange/tests/streams.rs 4 pass
gRPC Exchange service obsp-exchange/tests/grpc.rs 10 pass
Usage-policy gate in every binding obsp-exchange/tests/gate.rs 1 pass
Mounted in the gateway obsp-gateway/tests/exchange.rs 7 pass

External suite run once by hand (needs the network for its schemas, so not part of make check): stac-validator (core) on the landing Catalog, both Collections and both Items served from the example seed: all five valid against the STAC 1.1.0 core schemas (2026-11-21).

Suites that remain to run:

  • OGC executable test suites in TEAM Engine for Features Part 1 (ets-ogcapi-features10), EDR (ets-ogcapi-edr10) and Records: they need the TEAM Engine distribution and Maven downloads, which were not available offline;
  • the OGC SensorThings API test suite (ets-sta10), same reason;
  • stac-api-validator against a running gateway;
  • the WIS2 notification message schema of WMO and the CAP 1.2 XML schema of OASIS (not vendored here);
  • a real MQTT 5 broker (the tests use a minimal broker written in the test).

Known gaps

  • CQL2: S_TOUCHES, S_CROSSES, S_OVERLAPS and custom functions are refused; geometry is planar 2D.
  • EDR: no instances, corridor or items queries; CRS84 only; no z axis in CoverageJSON domains.
  • SensorThings: no geo.* or st_* filter functions and no lambda operators, although the service root lists req/request-data; HistoricalLocations is always empty; no create, update or delete (refused by design).
  • STAC: a product version is the Item (as the draft binding says); obsp:provenance falls back to the catalogue record and the manifest digest until provenance bundles are served.
  • CloudEvents: the RequestContext attributes are not carried (the read side has no request context); the id of a record version after the first is uni@version.
  • gRPC: plaintext only (the host adds mutual TLS), no health service, Observe and Prove services not served.
  • Webhooks: http:// callbacks only; subscriptions live in memory and are lost on restart; the secret comes from /dev/urandom (a hash of time and process only on a system without it).
  • New records and notices reach a running gateway only through the library (Hub::publish_observation, Hub::publish_correction); no HTTP route publishes, by EXCH-3.