[ 
https://issues.apache.org/jira/browse/CONNECTORS-911?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13959421#comment-13959421
 ] 

Ahmet Arslan commented on CONNECTORS-911:
-----------------------------------------

in commit r 1579611 I see following mapping :

{code}

-    params.setBooleanParameter(CoreProtocolPNames.USE_EXPECT_CONTINUE,true);
-    params.setIntParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE,socketTimeout);
-    params.setBooleanParameter(CoreConnectionPNames.TCP_NODELAY,true);
-    
params.setBooleanParameter(CoreConnectionPNames.STALE_CONNECTION_CHECK,true);
-    
params.setIntParameter(CoreConnectionPNames.CONNECTION_TIMEOUT,connectionTimeout);
-    params.setIntParameter(CoreConnectionPNames.SO_TIMEOUT,socketTimeout);
-    params.setBooleanParameter(ClientPNames.ALLOW_CIRCULAR_REDIRECTS,true);
-    DefaultHttpClient localHttpClient = new 
DefaultHttpClient(connectionManager,params);
-    // No retries
-    localHttpClient.setHttpRequestRetryHandler(new HttpRequestRetryHandler()
-      {
-        public boolean retryRequest(
-          IOException exception,
-          int executionCount,
-          HttpContext context)
-        {
-          return false;
-        }
-      
-      });
-    localHttpClient.setRedirectStrategy(new DefaultRedirectStrategy());

+    RequestConfig.Builder requestBuilder = RequestConfig.custom()
+      .setCircularRedirectsAllowed(true)
+      .setSocketTimeout(socketTimeout)
+      .setStaleConnectionCheckEnabled(true)
+      .setExpectContinueEnabled(true)
+      .setConnectTimeout(connectionTimeout)
+      .setConnectionRequestTimeout(socketTimeout);
+

+    httpClient = HttpClients.custom()
+      .setConnectionManager(connectionManager)
+      .setMaxConnTotal(1)
+      .disableAutomaticRetries()
+      .setDefaultRequestConfig(requestBuilder.build())
+      .setDefaultSocketConfig(SocketConfig.custom()
+        .setTcpNoDelay(true)
+        .setSoTimeout(socketTimeout)
+        .build())
+      .setDefaultCredentialsProvider(credentialsProvider)
+      .setSSLSocketFactory(myFactory)
+      .setRequestExecutor(new HttpRequestExecutor(socketTimeout))
+      .setRedirectStrategy(new DefaultRedirectStrategy())
+      .build();
+
{code}

q1) In this mapping I don't see  //No Retries  
{{HttpClientBuilder.setRetryHandler(new HttpRequestRetryHandler() …}} is this 
okay?
  
q2) Does {{HttpClientBuilder.setRequestExecutor(new 
HttpRequestExecutor(socketTimeout))}} correspond to 
{{params.setIntParameter(CoreProtocolPNames.WAIT_FOR_CONTINUE,socketTimeout)}}? 
  Should I use it in solrconnector.patch?     

> Work on removing HttpClient 4.3 deprecation warnings
> ----------------------------------------------------
>
>                 Key: CONNECTORS-911
>                 URL: https://issues.apache.org/jira/browse/CONNECTORS-911
>             Project: ManifoldCF
>          Issue Type: Task
>          Components: Elastic Search connector, Framework crawler agent, JIRA 
> connector, Lucene/SOLR connector, OpenSearchServer connector, RSS connector, 
> Web connector, Wiki connector
>    Affects Versions: ManifoldCF 1.6
>            Reporter: Karl Wright
>            Assignee: Karl Wright
>             Fix For: ManifoldCF 1.6
>
>         Attachments: CONNECTORS-911.patch, SolrConnector.patch, 
> SolrConnector.patch
>
>
> HttpClient 4.3 deprecates pretty much the entire way you used to build 
> httpclient instances; fixing this requires a lot of work in ManifoldCF.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to