Client
GrpcClient connects to a gRPC server and provides service stubs via withService.
Configuration
- credentials
Sets client credentials. Use
plaintext()for insecure connections (testing only) ortls { ... }for secure communication. Default TLS credentials are used when not specified.- messageMarshallerResolver
A
GrpcMarshallerResolverfor custom serialization. Not needed when using generated Protobuf types. See No proto.- overrideAuthority
Overrides the authority used with TLS and HTTP virtual hosting. Does not change the actual host the client connects to.
- intercept(...)
Adds client-side interceptors. Interceptors are executed in the order they are added.
- keepAlive { ... }
Configures keep-alive pings to detect broken connections. Disabled by default.
Lifecycle
Call shutdown() to stop accepting new calls and awaitTermination() to wait for in-flight calls to complete. Use shutdownNow() to cancel all calls immediately.