Skip to content

Sessions and feed recovery

Bridge, supplier, maintenance and updater each create local OMS adapter clients and load reusable sessions from the shared database. Several clients can use a session concurrently. Closing an ordinary client leaves its saved session available.

A per-account MongoDB lease coordinates login and maintenance, rather than ordinary requests or stream delivery. It lasts 30 seconds and renews every ten seconds. Credential revisions and disabled accounts invalidate active supplier clients within the one-second account poll interval plus database and cleanup time. Transient validation failures retain sessions and report temporary unavailability.

Maintenance defaults to 08:00–18:00 Asia/Tehran, scans every minute and targets three sessions per account with staggered replenishment. Configure its window and target through [schedule]. On-demand acquisition works when maintenance is stopped or outside this window.

Only Bridge starts order workers. See managed orders for their distinct recovery guarantees.

Ephoenix and OMEX retain healthy subscriptions when individual instruments fail. Rejected batches are split to isolate failing identifiers. Timeouts and server errors require repeated individual failure plus a successful control subscription before quarantine. Authentication failures trigger session recovery; rate limits and transport outages back off without mass quarantine.

The hub_subscription_health MongoDB collection has a unique key of (oms, hub, identifier_kind, identifier), shared across accounts and brokers of the same OMS. Records contain state (quarantined or ok), failure timestamps and count, last probe, recovery time, revision and sanitized error category/status. Inspect these records and structured omsbridge logs; there is no separate management API.

During a database outage, local quarantine stays active and writes retry while receiving continues. Unsaved failures cannot survive a restart during that outage. An accepted subscription does not require quote traffic, so quiet markets are not automatically considered failed subscriptions.

Schedule the existing update command daily:

Terminal window
docker compose run --rm --no-deps market-data -m marketdata.update --config /etc/omsbridge/config.toml

After stock and commodity updates it probes each quarantined identifier at most once per Asia/Tehran calendar day, using separate hub connections and reusable sessions. Probes are sequential per OMS, at most one request per second, with a ten-second timeout. Each affected OMS needs an enabled account.

Acceptance marks a record ok; rejection retains quarantine. Account, authentication, transport and ambiguous server failures report operational job failure while retaining records. Active hubs reload quarantine every 60 seconds and resubscribe recovered identifiers that are still desired. Reconnects skip quarantined identifiers.

READY means reconciliation completed and may represent a partial selection. Supplier snapshot recovery excludes unaccepted identifiers. Commodity market subscriptions are independent of individual-instrument quarantine. Quote timestamps remain meaningful independently of subscription state.