use of org.apache.skywalking.apm.testcase.baidu.brpc.interfaces.Echo.EchoResponse in project skywalking-java by apache.
the class CaseController method brpc.
@RequestMapping("/brpc")
@ResponseBody
public String brpc() {
RpcClientOptions clientOption = new RpcClientOptions();
clientOption.setProtocolType(Options.ProtocolType.PROTOCOL_BAIDU_STD_VALUE);
clientOption.setWriteTimeoutMillis(1000);
clientOption.setReadTimeoutMillis(5000);
clientOption.setMaxTotalConnections(1000);
clientOption.setMinIdleConnections(10);
clientOption.setLoadBalanceType(LoadBalanceStrategy.LOAD_BALANCE_FAIR);
clientOption.setCompressType(Options.CompressType.COMPRESS_TYPE_NONE);
String serviceUrl = "list://127.0.0.1:1118";
Echo.EchoRequest request = Echo.EchoRequest.newBuilder().setMessage("helloooooooooooo").build();
RpcClient rpcClient = new RpcClient(serviceUrl, clientOption);
EchoService echoService = BrpcProxy.getProxy(rpcClient, EchoService.class);
try {
EchoResponse response = echoService.echo(request);
} catch (RpcException ex) {
}
rpcClient.stop();
return SUCCESS;
}
Aggregations