diff --git a/src/main/java/com/launchdarkly/client/EventProcessor.java b/src/main/java/com/launchdarkly/client/EventProcessor.java index 8659f4ce3..a578e771c 100644 --- a/src/main/java/com/launchdarkly/client/EventProcessor.java +++ b/src/main/java/com/launchdarkly/client/EventProcessor.java @@ -2,6 +2,7 @@ import com.google.common.util.concurrent.ThreadFactoryBuilder; import com.google.gson.Gson; +import org.apache.http.client.config.RequestConfig; import org.apache.http.client.methods.CloseableHttpResponse; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; @@ -62,7 +63,14 @@ class Consumer implements Runnable { Consumer(LDConfig config) { this.config = config; - client = HttpClients.custom().setProxy(config.proxyHost).build(); + RequestConfig requestConfig = RequestConfig.custom() + .setConnectTimeout(config.connectTimeout) + .setSocketTimeout(config.socketTimeout) + .setProxy(config.proxyHost) + .build(); + client = HttpClients.custom() + .setDefaultRequestConfig(requestConfig) + .build(); } @Override