Interceptors
Interceptors wrap RPC execution with cross-cutting behavior while handlers stay focused on business logic. Their order is observable: a request moves from the first interceptor toward the handler and the response unwinds in reverse.
Start with the default chain
import { createDefaultInterceptors } from '@connectum/interceptors';
const interceptors = createDefaultInterceptors({
timeout: { duration: 10_000 },
retry: { maxRetries: 2 },
});Error handling and validation are structural defaults. Timeout, bulkhead, circuit breaker, retry, fallback, and serializer behavior is opt-in because it changes request semantics. The canonical chain order, defaults, and standalone factories live in Built-in interceptors; exact fields live in DefaultInterceptorOptions.
Choose the extension route
| Need | Route |
|---|---|
| Configure the supported chain | Built-in interceptors |
| Add business-specific middleware | Custom interceptors |
| Apply behavior to selected services or methods | Method filtering |
| Authenticate or authorize calls | Auth and authz |
| Trace incoming or outgoing calls | Tracing |
| Look up an exact factory or option | @connectum/interceptors API |
Use native router scoping when an interceptor belongs to one service, a method-filter interceptor for declarative name patterns, and a custom interceptor only when selection depends on runtime request data.
Module route
The @connectum/interceptors module hub owns installation, the minimal example, key entry points, and Learn / Configure / API navigation.