Class UnaryGrpcClient
java.lang.Object
com.linecorp.armeria.client.grpc.protocol.UnaryGrpcClient
A
UnaryGrpcClient
can be used to make requests to a gRPC server without depending on gRPC stubs.
This client takes care of deframing and framing with the gRPC wire format and handling appropriate headers.
This client does not support compression. If you need support for compression, please consider using normal gRPC stubs or file a feature request.
-
Constructor Summary
ConstructorDescriptionUnaryGrpcClient(WebClient webClient)
Deprecated.Prefer using a standard client building pattern, e.g.:UnaryGrpcClient(WebClient webClient, SerializationFormat serializationFormat)
Deprecated.Prefer using a standard client building pattern, e.g.: -
Method Summary
Modifier and TypeMethodDescriptionCompletableFuture<byte[]>
Executes a unary gRPC client request.
-
Constructor Details
-
UnaryGrpcClient
Deprecated.Prefer using a standard client building pattern, e.g.:UnaryGrpcClient client = Clients.newClient("gproto+http://127.0.0.1:8080", UnaryGrpcClient.class);
Constructs aUnaryGrpcClient
for the givenWebClient
. -
UnaryGrpcClient
Deprecated.Prefer using a standard client building pattern, e.g.:UnaryGrpcClient client = Clients.newClient("gproto-web+http://127.0.0.1:8080", UnaryGrpcClient.class);
Constructs aUnaryGrpcClient
for the givenWebClient
andSerializationFormat
. The specifiedSerializationFormat
should be one ofUnaryGrpcSerializationFormats#PROTO
,UnaryGrpcSerializationFormats#PROTO_WEB
, orUnaryGrpcSerializationFormats#PROTO_WEB_TEXT
.
-
-
Method Details
-
execute
Executes a unary gRPC client request. The givenpayload
will be framed and sent to the path aturi
.uri
should be the method's URI, which is always of the format/:package-name.:service-name/:method
. For example, for the proto packagearmeria.protocol
, the service nameCoolService
and the method nameRunWithoutStubs
, theuri
would be/armeria.protocol.CoolService/RunWithoutStubs
. If you aren't sure what the package, service name, and method name are for your method, you should probably use normal gRPC stubs instead of this class.
-