Connectum Runtime Architecture
createServer() composes one service process: typed services, protocol plugins, request middleware, a network listener and a coordinated startup and shutdown lifecycle. A process can host several service typeName values. Deployment infrastructure connects to that process through explicit interfaces.
Boundary and ownership
Connectum owns transport selection, route registration, RPC dispatch, the ordered server-interceptor chain and the Context supplied to typed handlers. It coordinates startup, request drain and shutdown. Catalog dispatch, EventBus integration and telemetry are capabilities the application supplies explicitly.
The gateway, service mesh, scheduler, registry, message broker and telemetry backend remain outside this boundary. They are not framework prerequisites. Exact configuration fields belong to the generated core API.
Build-time inputs
Proto schemas, generated service descriptors and the optional generated service catalog define the contracts consumed by route and catalog registration. They are build-time inputs, not stages that execute for every RPC. They therefore sit outside the runtime paths in the diagrams.
Use Scaffolding for the generation workflow.
Runtime composition
Inbound RPC requests follow one shared execution path. TransportManager owns the selected Node transport; buildRoutes() composes services and protocol registrations. The configured server interceptors wrap the matched route, which invokes a typed handler with a Connectum Context.
Protocol modules such as Health Check and Reflection register additional RPC routes through the same router contract. Their optional HTTP handlers, such as /healthz, run through the adapter fallback, outside the RPC interceptor chain.
Network and in-process parity
An in-process client opens no socket. createLocalTransport() uses createRouterTransport(routes) with the same serverInterceptors before reaching the handler. Client-side interceptors may additionally wrap that call.
The shared route and interceptor boundary is the parity invariant: application behavior should not depend on whether a locally mounted service was reached over HTTP or through the in-process transport. The In-Process Transport guide defines the exact guarantee, limitations and test utilities.
Catalog call routing
With a service catalog configured, handlers use ctx.call and ctx.stream for typed service calls. The per-server catalog dispatcher resolves the method and builds the outgoing call frame from the current handler context:
- A locally mounted
typeNameuses the in-process transport and re-enters the server's routes, interceptors and typed handler chain. - A target not mounted locally goes to
remoteResolver, which supplies a ConnectRPCTransport. For a remote Connectum server, the call crosses the process boundary and enters itsconnectNodeAdapter({ routes, interceptors }).
CatalogDispatcher selects the transport; it does not select a different handler contract. Both the in-process createRouterTransport() path and the remote connectNodeAdapter() path apply the target server's routes and server interceptors before the handler. Stacked cards represent additional registered service typeName values; response arrows are omitted for legibility. The incoming cancellation signal cascades to catalog calls unless replaced in call options. The timeout is clamped to the remaining incoming deadline: an override can shorten it but cannot extend it. Inbound headers are not forwarded implicitly; only configured allow-listed headers and explicit call headers propagate.
A process that makes no typed cross-service calls does not need a catalog. The Service Catalog guide owns configuration and error semantics; Remote Resolvers explains transport resolution. To choose between synchronous calls and asynchronous events, use Communication.
Extension seams
Each optional capability attaches at a defined point:
| Capability | Runtime attachment | External dependency |
|---|---|---|
| Server interceptors | Ordered ConnectRPC request chain | Optional identity, policy, or application services |
| Protocol plugins | Register RPC routes and optional HTTP fallbacks | Protocol-specific clients and tooling |
| Service catalog | Typed ctx.call / ctx.stream dispatch | Resolver-supplied remote transports |
| EventBus | Supplied to createServer(); the server starts and stops it | None for Memory; NATS, Kafka, Redis, or AMQP broker otherwise |
| OpenTelemetry | Server/client interceptors and an explicitly configured provider | OTLP collector or console exporter |
Install and compose only the modules the service needs. OpenTelemetry instrumentation does not make the telemetry backend part of the process; similarly, managing an EventBus lifecycle does not start its external broker.
Deployment boundary
Deployment determines how the process is packaged, scheduled and exposed:
- Docker packages the process.
- Kubernetes schedules it and drives probes.
- Envoy Gateway provides an optional edge and REST transcoding path.
- Service Mesh provides optional traffic policy and workload mTLS.
- Observability selects telemetry signals and backends.
Related
- Server: composition and lifecycle setup.
- Transport Matrix: HTTP/1.1, h2c, TLS/ALPN and RPC-kind support.
- Package decomposition ADR: package-boundary rationale. The ADR index records the other architecture decisions.