/** * Returns a {@link RpcResponse} corresponding to the given {@link Status} generated by the server. */ public static RpcResponse rpcResponse(Status status, @Nullable Object message) { if (status.isOk()) { return RpcResponse.of(message); } else { return RpcResponse.ofFailure(status.asException()); } }
final RpcRequest rpcReq = RpcRequest.of(HelloService.Iface.class, "hello", "Armeria"); final HttpResponse res = HttpResponse.of(HttpStatus.OK); final RpcResponse rpcRes = RpcResponse.of("Hello, Armeria!"); final ClientRequestContext ctx = ClientRequestContextBuilder.of(req)
/** * Returns a {@link RpcResponse} corresponding to the given {@link Status} generated by the server. */ public static RpcResponse rpcResponse(Status status, @Nullable Object message) { if (status.isOk()) { return RpcResponse.of(message); } else { return RpcResponse.ofFailure(status.asException()); } }
final RpcResponse rpcRes = RpcResponse.of("Hello, trustin!"); final RequestLogBuilder logBuilder = ctx.logBuilder(); logBuilder.requestContent(rpcReq, req);