Service Communication
Orders needs an answer about stock before replying to a customer. It calls Inventory's contract and waits for the result. That is the synchronous path.
Inside the Orders handler, with generated contract types in scope:
const stock = await ctx.call(
'shop.v1.InventoryService/CheckStock',
create(CheckStockRequestSchema, { sku: req.sku }),
);Choose the mechanism
Learn how the catalog knows the method, then how the server chooses its route.
Patterns, client policy and other communication choices
| Need | Canonical route |
|---|---|
| Decide between request/response, streaming, and events | Choosing a mechanism |
Call generated internal services through ctx.call / ctx.stream | Service catalog |
| Select and compose endpoint resolution | Resolvers |
| Add client tracing, deadlines, retry, or credentials | Client interceptors |
| Model fan-out, partial failure, or server streaming | Communication patterns |
| Keep calls in the same process with transport parity | In-process transport |
| React asynchronously through a broker | Events |
Synchronous baseline
Use the generated service catalog when services are part of the Connectum contract. It keeps target resolution, propagated request context, deadlines, and typed call names in one boundary. Use a direct ConnectRPC createClient() only for an external or deliberately uncatalogued API.
For direct gRPC calls, the transport must support HTTP/2. Client-side resilience belongs around the outgoing transport, and only client-safe interceptors should be composed there. The exact supported set and ordering are owned by Client interceptors, not repeated on every communication page.
Operational rule
Synchronous calls couple caller availability and latency to the downstream service. Events decouple time but add delivery, idempotency, ordering, and broker operations. The mechanism decision guide owns that trade-off; the focused pages own implementation details.