Skip to content
AdvancedDocs 1.3.x

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.

One process and its extension seams One Connectum process composes shared RPC dispatch, protocol HTTP fallbacks and optional catalog, EventBus and telemetry capabilities while deployment infrastructure and remote systems remain outside. Compose one process with createServer() Build time: schemas, descriptors and optional generated catalog One process / createServer() register · start · drain · stop Outside runtime Network adapter + routesTransportManager owns HTTPservice / protocol RPC routes Shared RPCboundarynetwork + local callersadmission + interceptorstyped handler + Context HTTPfallback/healthzoutside RPCinterceptors Optional catalogctx.call / ctx.streamlocal or remoteResolver EventBussupplied busstart / stop Opt-in telemetryprovider + server / client interceptors Infrastructuregateway / meshscheduler / registryoutside process Remote RPCresolver transportcrosses process Broker /OTLP backendexplicit integrationoutside process
createServer() owns one process. Catalog, EventBus and OTel are explicit additions; the bus can stay in memory. Protocol HTTP fallbacks sit outside the RPC chain. External infrastructure is selected independently.

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.

Connectum service process composition RPC clients enter the createServer runtime through the network transport, shared ConnectRPC route tree, server interceptor chain, and typed handlers. Protocol plugins register with the route tree. Optional EventBus and OpenTelemetry capabilities remain explicit; their broker and telemetry sinks stay outside the Connectum service process. Connectum service process createServer() owns registration, startup, drain, and shutdown SHARED RPC EXECUTION PATH EXPLICIT CAPABILITIES · OPT-IN RPC clients Connect · gRPC TransportManager HTTP/1.1 · h2c · TLS buildRoutes() services + protocols serverInterceptors auth · validation · OTel Typed handlers Connectum Context ProtocolRegistration[] Health · Reflection custom registrations EventBus routing · middleware · adapter server-managed lifecycle OpenTelemetry server + client interceptors provider · traces · metrics · logs adapter I/O export Broker or memory NATS · Kafka · Redis · AMQP Telemetry sink OTLP collector · console
The solid route is the shared inbound RPC path. Dashed routes are explicit integrations: protocol registration and OpenTelemetry instrumentation. Brokers and telemetry sinks remain outside the service process.

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:

  1. A locally mounted typeName uses the in-process transport and re-enters the server's routes, interceptors and typed handler chain.
  2. A target not mounted locally goes to remoteResolver, which supplies a ConnectRPC Transport. For a remote Connectum server, the call crosses the process boundary and enters its connectNodeAdapter({ routes, interceptors }).
Local and remote Connectum service catalog routing A handler calls ctx.call or ctx.stream. CatalogDispatcher resolves a local target through createLocalTransport and createRouterTransport over routes with serverInterceptors. For a non-local typeName, remoteResolver supplies a ConnectRPC Transport that crosses to another createServer instance, where connectNodeAdapter applies routes and server interceptors before invoking the target handler. createServer() · caller and local services services filtered by enabledServices and registered in routes remote createServer() separate service process registeredServiceTypeNames registeredServiceTypeNames isLocal network handler Context ctx.call · ctx.stream CatalogDispatcher _resolveTransport() remoteResolver Transport | null createLocalTransport in-process · no socket createRouterTransport routes serverInterceptors local target handler matched typeName · other services behind Transport unary() · stream() connectNodeAdapter() routes + server interceptors remote target handler matched typeName
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:

CapabilityRuntime attachmentExternal dependency
Server interceptorsOrdered ConnectRPC request chainOptional identity, policy, or application services
Protocol pluginsRegister RPC routes and optional HTTP fallbacksProtocol-specific clients and tooling
Service catalogTyped ctx.call / ctx.stream dispatchResolver-supplied remote transports
EventBusSupplied to createServer(); the server starts and stops itNone for Memory; NATS, Kafka, Redis, or AMQP broker otherwise
OpenTelemetryServer/client interceptors and an explicitly configured providerOTLP 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: