@Override public ApacheHttpAsyncClient createHttpClient(Config config, SharedResourcesBroker<GobblinScopeTypes> broker) { return new ApacheHttpAsyncClient(HttpAsyncClientBuilder.create(), config, broker); }
public ApacheHttpAsyncClient(HttpAsyncClientBuilder builder, Config config, SharedResourcesBroker<GobblinScopeTypes> broker) { super (broker, HttpUtils.createApacheHttpClientLimiterKey(config)); config = config.withFallback(FALLBACK); RequestConfig requestConfig = RequestConfig.copy(RequestConfig.DEFAULT) .setSocketTimeout(config.getInt(REQUEST_TIME_OUT_MS_KEY)) .setConnectTimeout(config.getInt(CONNECTION_TIME_OUT_MS_KEY)) .setConnectionRequestTimeout(config.getInt(CONNECTION_TIME_OUT_MS_KEY)) .build(); try { builder.disableCookieManagement().useSystemProperties().setDefaultRequestConfig(requestConfig); builder.setConnectionManager(getNHttpConnManager(config)); client = builder.build(); client.start(); } catch (IOException e) { throw new RuntimeException("ApacheHttpAsyncClient cannot be initialized"); } }
@Override public ApacheHttpAsyncClient createHttpClient(Config config, SharedResourcesBroker<GobblinScopeTypes> broker) { return new ApacheHttpAsyncClient(HttpAsyncClientBuilder.create(), config, broker); }
public ApacheHttpAsyncClient(HttpAsyncClientBuilder builder, Config config, SharedResourcesBroker<GobblinScopeTypes> broker) { super (broker, HttpUtils.createApacheHttpClientLimiterKey(config)); config = config.withFallback(FALLBACK); RequestConfig requestConfig = RequestConfig.copy(RequestConfig.DEFAULT) .setSocketTimeout(config.getInt(REQUEST_TIME_OUT_MS_KEY)) .setConnectTimeout(config.getInt(CONNECTION_TIME_OUT_MS_KEY)) .setConnectionRequestTimeout(config.getInt(CONNECTION_TIME_OUT_MS_KEY)) .build(); try { builder.disableCookieManagement().useSystemProperties().setDefaultRequestConfig(requestConfig); builder.setConnectionManager(getNHttpConnManager(config)); client = builder.build(); client.start(); } catch (IOException e) { throw new RuntimeException("ApacheHttpAsyncClient cannot be initialized"); } }