Class UnaryGrpcClient
java.lang.Object
com.linecorp.armeria.client.grpc.protocol.UnaryGrpcClient
@UnstableApi public final class UnaryGrpcClient extends Object
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
Constructors Constructor Description UnaryGrpcClient(WebClient webClient)
Constructs aUnaryGrpcClient
for the givenWebClient
. -
Method Summary
Modifier and Type Method Description CompletableFuture<byte[]>
execute(String uri, byte[] payload)
Executes a unary gRPC client request.
-
Constructor Details
-
UnaryGrpcClient
Constructs aUnaryGrpcClient
for the givenWebClient
.
-
-
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.
-