import com.twitter.finagle.Http;
import com.twitter.finagle.http.Request;
import com.twitter.finagle.http.Response;
public class HttpClient {
private final Service<Request, Response> service;
public HttpClient() {
this.service = Http.client()
.withSessionPool()
.newService(dest, "client");
}
public Response sendRequest(Request request) throws Exception {
return Await.result(service.apply(request));
}
}
compression {
enabled = true
level = 6
}
commonPool {
type = "host"
sizeMin = 10
sizeMax = 100
}