Component ยท Control side
EventHub (Postgres-backed)
BOTH Component Control plane
What it is
EventHub is AMS's small event bus built on Postgres. When AMS needs to tell a gateway that something changed, such as a new LLM provider deployment, it writes an event row. Each connected gateway has a subscriber, and a polling loop in AMS checks the table and pushes new events over the gateway's WebSocket.
Why it exists
Gateways must learn about changes quickly, without AMS needing a separate message broker.
How it works
- Services publish events into the table eventhub_events in Postgres.
- One polling loop in AMS checks the table every 2 seconds (the default in the code) and hands new events to each connected gateway's subscriber.
- Events are sent over the gateway's WebSocket. For a deployment the gateway then downloads the full definition and sends back an acknowledgement.
- If broadcasting fails, the deployment itself still succeeds.
- Old events are cleaned up periodically.
Identity and access
Not applicable on its own. It rides on the internal server's WebSocket, which is protected by the gateway's api-key.
Key facts
- Storage
- Postgres table eventhub_events
- Poll interval
- 2 seconds (default)
- Side
- Control plane
- Namespace
- wso2-amp
Talks to (1)
- reads from Postgres (AMS DB) eventhub_events, eventhub_gateway_statesSQL
Used by (2)
- read by AMS internal server :9243 Events fanned out to gateway WSPostgres poll
- called by agent-manager-service (AMS) GatewayEventsService publishes gateway events into the EventHub tablesin-process Go call, then SQL insert in one transaction