Skip to content
CommunicationDocs 1.3.x

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.

Known contracts, selected routes and outgoing policy Generated contract knowledge supports catalog calls whose outgoing policy wraps either a local transport or a remote resolver transport across communication patterns and deployment roles. Generated service catalogCompile-time contract knowledgeRuntime descriptors; no endpoints Catalog callctx.call / ctx.streamInherit handler deadline and signal Call patternsChains and fan-outStreams + cancellationTranslate partial errors Outgoing client policyAuth, traces and client-safe retryOnce on local + remote routes Runnable routingexampleTogether / split rolesNo route: Unavailable Choose a routeMounted local target wins Local transportDispatches in-processRemote resolver is bypassed Remote resolverMap / DNS / env → transportCache, endpoint hints and mocks
The catalog supplies types and descriptors, without deployment addresses. Outgoing policy wraps each catalog call once, on local and remote routes. Locally mounted targets bypass the remote resolver.

Inside the Orders handler, with generated contract types in scope:

typescript
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
NeedCanonical route
Decide between request/response, streaming, and eventsChoosing a mechanism
Call generated internal services through ctx.call / ctx.streamService catalog
Select and compose endpoint resolutionResolvers
Add client tracing, deadlines, retry, or credentialsClient interceptors
Model fan-out, partial failure, or server streamingCommunication patterns
Keep calls in the same process with transport parityIn-process transport
React asynchronously through a brokerEvents

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.