Video series · Episode 11 · 10–12 min

Service registry & proxies: client-side interception

Chenile ships its own registry and a proxy framework: call a service through its interface, routed locally or remotely, with a configurable client-side interceptor chain on the way out.

← All episodes

Episode goal: demonstrate the client side of Chenile — a proxy that implements the target interface, dynamic local/remote routing, and a client-side interceptor chain that mirrors the server pipeline.

Cold open
On camera: “We spent the series on the server side of a call. But every service is also a client. Chenile treats the outbound side with the exact same respect — no hand-written transport, and interception on the way out.”
The registry
On screen: chenile-service-registry. Voiceover: “Chenile ships its own service registry — remote service, operation and parameter definitions. DB-backed, cached, fingerprinted for change detection, with a delegate that lets a client pull a service’s definitions. It’s the same registry that carries a service’s policies.”
Build a proxy
Demo: proxyBuilder.buildProxy(BService.class, "bService", headerCopier). “The object it returns implements BService. I call bService.op(payload) like a local object — Chenile handles everything else. HeaderCopier carries correlation, identity and tenant outward.”
Local or remote
Lower third: “Same caller code — local or remote.” Show ProxyTypeRouter: if the callee is in the same JVM → synchronous LocalProxyInvoker (that’s your modulith); if remote → RemoteProxyInvoker over HTTP, or an event via ChenilePubSub.
Demo — seamless swap
Run with the callee co-located (local, in-process). Then deploy it separately and re-run the identical caller code — now it goes remote. “I changed deployment, not code. That’s ProxyMode.COMPUTE_DYNAMICALLY.”
Client-side interception
Voiceover: “Now the payoff. On the way out, the proxy runs a client-side interceptor chain — Chenile calls them client processors — against a RemoteChenileExchange.” Show chips: header propagation, auth token, correlation, logging, retry/timeout, and the response handler + body-type selector.
Per service / per operation
Point at ServiceSpecificClientProcessorsInterpolation and OperationSpecificClientProcessorsInterpolation. “The chain is configurable per service and per operation. Add a retry to one operation, an extra header to one service — by configuration.”
The symmetry
Lower third: “Server pipeline in; client-processor chain out. One interception philosophy, both directions.”
Recap card
“Registry + proxy: call the interface, route local/remote dynamically, intercept on the client side — all by configuration.”

Companion reading: Service registry & proxies: calling services through their interface