WIth the older version of the SDK because you were calling to get the json file yourself you were creating the ClosableHttpClient yourself and using that to get the file.
CloseableHttpClient httpclient = HttpClients.createDefault();
HttpGet httpget = new HttpGet(configEndpoint);
RequestConfig requestConfig = RequestConfig.copy(defaultRequestConfig)
.setProxy(new HttpHost(proxyHost, proxyPort))
.build();
httpget.setConfig(requestConfig);
With the new OptimizelyFactory it allows you to use withOptimizelyHttpClient but the OptimizelyHttpClient builder doesn't let your define specific HttpClient settings.
|
.setDefaultRequestConfig(HttpClientUtils.DEFAULT_REQUEST_CONFIG) |
EventHandler eventHandler = AsyncEventHandler.builder()
.withQueueCapacity(20000)
.withNumWorkers(5)
.build();
ProjectConfigManager projectConfigManager = HttpProjectConfigManager.builder()
.withSdkKey(sdkKey)
.withOptimizelyHttpClient(OptimizelyHttpClient.builder().build())
.withPollingInterval(30, TimeUnit.MINUTES)
.build();
Optimizely optimizely = Optimizely.builder()
.withConfigManager(projectConfigManager)
.withEventHandler(eventHandler)
.build();
WIth the older version of the SDK because you were calling to get the
jsonfile yourself you were creating the ClosableHttpClient yourself and using that to get the file.With the new OptimizelyFactory it allows you to use
withOptimizelyHttpClientbut theOptimizelyHttpClientbuilder doesn't let your define specificHttpClientsettings.java-sdk/core-httpclient-impl/src/main/java/com/optimizely/ab/OptimizelyHttpClient.java
Line 103 in 543c1c2