Class UnaryGrpcClient
- java.lang.Object
-
- com.linecorp.armeria.common.grpc.protocol.UnaryGrpcClient
-
public class UnaryGrpcClient extends Object
AUnaryGrpcClientcan 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(com.linecorp.armeria.client.HttpClient httpClient)Constructs aUnaryGrpcClientfor the givenHttpClient.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableFuture<byte[]>execute(String uri, byte[] payload)Executes a unary gRPC client request.
-
-
-
Constructor Detail
-
UnaryGrpcClient
public UnaryGrpcClient(com.linecorp.armeria.client.HttpClient httpClient)
Constructs aUnaryGrpcClientfor the givenHttpClient.
-
-
Method Detail
-
execute
public CompletableFuture<byte[]> execute(String uri, byte[] payload)
Executes a unary gRPC client request. The givenpayloadwill be framed and sent to the path aturi.urishould 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 nameCoolServiceand the method nameRunWithoutStubs, theuriwould 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.
-
-