Skip to main content

routing-engine — Sync Contract

Status: populated | Last updated: 2026-04-18

This document defines what other services depend on from routing-engine and what routing-engine depends on from others.

1. Consumers of routing-engine

ServiceInterfaceDependency typeSLA expectation
sms-orchestratorgRPC RoutingService/SelectOperatorSynchronous, blocking hot pathP95 ≤ 50 ms; availability 99.9%

sms-orchestrator must not proceed with message dispatch without a valid OperatorConfig response. If routing-engine returns UNAVAILABLE or NOT_FOUND, the orchestrator should move the message to the dead-letter queue.

2. Dependencies of routing-engine

DependencyInterfaceFailure mode if unavailable
PostgreSQL ops_routing schemaRead-only SQL via connection poolService cannot resolve cache misses; returns UNAVAILABLE to callers
RedisSET/GET/MGET/SCANCache miss fallback to DB still works; health cache reads return empty (assume all operators healthy with degraded accuracy)
NATS JetStream operator.healthConsumerHealth cache becomes stale; TTL auto-expires after 60 s; no crash

3. Schema Stability Guarantees

gRPC Proto

FieldStability
SelectOperatorRequest.toStable
SelectOperatorRequest.account_idStable
SelectOperatorRequest.message_typeStable — new enum values may be added; callers should handle UNSPECIFIED
OperatorConfig.*Stable
New fields may be addedNon-breaking (proto3 default values)
Fields will not be removed or renumberedGuaranteed

NATS Event Contracts

routing-engine consumes OperatorHealthEvent. Any breaking change to that schema must be co-ordinated with operator-management-service. Version field "version": "1.0" allows consumers to gate behaviour by schema version.

4. Versioning Policy

  • gRPC package is ghasi.sms.routing.v1 — breaking changes require a v2 package and a migration window.
  • The existing v1 proto will be maintained for a minimum of 90 days after v2 is available.