Finagle
Build request:
RequestBuilder requestBuilder = new RequestBuilder() // custom class
.withMethod(method)
.withHeader(xxx, "xxx")
.withPath(endpoint)
.withParams(request.getPathParams())
.withQueryParams(request.getQueryParams());
Service<Request, Response> restService = restServiceProvider.getService(serviceLabel);
Finagle Call:
final Future<O> responseFuture = filter.apply(request, restService);
final O result
try {
result = Await.result(responseFuture, Duration.fromMilliseconds(config.getTotalRequestTimeout()));
} catch (Exception e) { ... }
return result;
Comments