Runtime Topology: 007 Messaging NATS Replacement
Parent state: 003-containerized-compose-runtime
Entrypointsβ
- Browser/UI ingress:
http://localhost:8080 - NATS client port (internal compose network):
4222 - NATS monitoring (optional local):
8222 - NATS websocket ingress path (proxied):
/nats-ws
Componentsβ
nats-brokerreplaces messaging role previously handled bytrade-feed.trade-servicepublishestrades.new.trade-processorconsumestrades.newand publishes account-scoped trade/position updates.web-front-end-angularsubscribes to account-scoped update subjects throughnats.ws.
Networkingβ
- Service-to-service messaging uses NATS TCP over compose network.
- Browser real-time stream uses WebSocket upgrade through ingress path
/nats-ws. - Existing REST routing through ingress remains unchanged.
Startup / Health Orderβ
nats-brokermust be healthy before trade-service/trade-processor startup.- Frontend may start before broker, but stream subscriptions must retry until broker and websocket path are available.
Source-of-Truth Filesβ
system/messaging-subject-map.mdsystem/docker-compose.nats.snippet.yamlsystem/ingress-nginx.nats-ws.snippet.conf