@Override public AvroHttpWriterBuilder fromConfig(Config config) { config = config.withFallback(FALLBACK); ApacheHttpClient client = new ApacheHttpClient(HttpClientBuilder.create(), config, broker); this.client = client; String urlTemplate = config.getString(HttpConstants.URL_TEMPLATE); String verb = config.getString(HttpConstants.VERB); String contentType = config.getString(HttpConstants.CONTENT_TYPE); this.asyncRequestBuilder = new ApacheHttpRequestBuilder(urlTemplate, verb, contentType); Set<String> errorCodeWhitelist = HttpUtils.getErrorCodeWhitelist(config); this.responseHandler = new ApacheHttpResponseHandler(errorCodeWhitelist); return this; } }
public ApacheHttpClient(HttpClientBuilder 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(); builder.disableCookieManagement().useSystemProperties().setDefaultRequestConfig(requestConfig); builder.setConnectionManager(getHttpConnManager(config)); client = builder.build(); }
public ApacheHttpClient(HttpClientBuilder 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(); builder.disableCookieManagement().useSystemProperties().setDefaultRequestConfig(requestConfig); builder.setConnectionManager(getHttpConnManager(config)); client = builder.build(); }
@Override public AvroHttpWriterBuilder fromConfig(Config config) { config = config.withFallback(FALLBACK); ApacheHttpClient client = new ApacheHttpClient(HttpClientBuilder.create(), config, broker); this.client = client; String urlTemplate = config.getString(HttpConstants.URL_TEMPLATE); String verb = config.getString(HttpConstants.VERB); String contentType = config.getString(HttpConstants.CONTENT_TYPE); this.asyncRequestBuilder = new ApacheHttpRequestBuilder(urlTemplate, verb, contentType); Set<String> errorCodeWhitelist = HttpUtils.getErrorCodeWhitelist(config); this.responseHandler = new ApacheHttpResponseHandler(errorCodeWhitelist); return this; } }