Module io.inverno.mod.grpc.client
Package io.inverno.mod.grpc.client
Interface GrpcRequest<A extends com.google.protobuf.Message>
- Type Parameters:
A
- the request message type
- All Superinterfaces:
GrpcBaseRequest
- All Known Subinterfaces:
GrpcRequest.Streaming<A>
,GrpcRequest.Unary<A>
Represents a client gRPC request in a client exchange.
Depending on the kind of exchange considered a gRPC request can be GrpcRequest.Unary
when a single message is sent to the endpoint or GrpcRequest.Streaming
when a stream of messages
is sent to the endpoint.
Once the request has been sent to the endpoint it is no longer possible to modify it resulting in IllegalStateException
on such operations.
- Since:
- 1.9
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
GrpcRequest.Streaming<A extends com.google.protobuf.Message>
Represents a streaming (stream of messages) request.static interface
GrpcRequest.Unary<A extends com.google.protobuf.Message>
Represents a unary (single message) request. -
Method Summary
Modifier and TypeMethodDescriptionmetadata
(Consumer<GrpcOutboundRequestMetadata> metadataConfigurer) Configures the gRPC request metadata to send in the request.Methods inherited from interface io.inverno.mod.grpc.base.GrpcBaseRequest
getFullMethodName, getMethodName, getServiceName, metadata
-
Method Details
-
metadata
GrpcRequest<A> metadata(Consumer<GrpcOutboundRequestMetadata> metadataConfigurer) throws IllegalStateException Configures the gRPC request metadata to send in the request.
- Parameters:
metadataConfigurer
- an outbound request metadata configurer- Returns:
- the request
- Throws:
IllegalStateException
- if the request has already been sent to the endpoint
-