Search in sources :

Example 1 with ApacheHttpTransport

use of com.google.api.client.http.apache.ApacheHttpTransport in project camel by apache.

the class GooglePubsubConnectionFactory method getMultiThreadClient.

public Pubsub getMultiThreadClient(int parallelThreads) throws Exception {
    PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager();
    cm.setDefaultMaxPerRoute(parallelThreads);
    cm.setMaxTotal(parallelThreads);
    CloseableHttpClient httpClient = HttpClients.createMinimal(cm);
    return buildClient(new ApacheHttpTransport(httpClient));
}
Also used : CloseableHttpClient(org.apache.http.impl.client.CloseableHttpClient) ApacheHttpTransport(com.google.api.client.http.apache.ApacheHttpTransport) PoolingHttpClientConnectionManager(org.apache.http.impl.conn.PoolingHttpClientConnectionManager)

Aggregations

ApacheHttpTransport (com.google.api.client.http.apache.ApacheHttpTransport)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1 PoolingHttpClientConnectionManager (org.apache.http.impl.conn.PoolingHttpClientConnectionManager)1