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
ConstructorsConstructorDescriptionUnaryGrpcClient(com.linecorp.armeria.client.WebClient webClient) Deprecated.Prefer using a standard client building pattern, e.g.:UnaryGrpcClient(com.linecorp.armeria.client.WebClient webClient, com.linecorp.armeria.common.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 aUnaryGrpcClientfor the givenWebClient. -
UnaryGrpcClient
@Deprecated public UnaryGrpcClient(com.linecorp.armeria.client.WebClient webClient, com.linecorp.armeria.common.SerializationFormat serializationFormat) 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 aUnaryGrpcClientfor the givenWebClientandSerializationFormat. The specifiedSerializationFormatshould be one ofUnaryGrpcSerializationFormats#PROTO,UnaryGrpcSerializationFormats#PROTO_WEB, orUnaryGrpcSerializationFormats#PROTO_WEB_TEXT.
-
-
Method Details
-
execute
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.
-