# Re-Index asynchronously with high level rest client

**URL:** <https://discuss.elastic.co/t/re-index-asynchronously-with-high-level-rest-client/222038>\
**Category:** Elasticsearch\
**Created:** [March 4, 2020, 10:25am UTC](https://discuss.elastic.co/t/re-index-asynchronously-with-high-level-rest-client/222038 "2020-03-04T10:25:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rajuy6mca](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rajuy6mca/32/63784_2.png) [@rajuy6mca](https://discuss.elastic.co/u/rajuy6mca)\
**Post date:** [March 4, 2020, 10:25am UTC](https://discuss.elastic.co/t/re-index-asynchronously-with-high-level-rest-client/222038/1 "2020-03-04T10:25:28Z")

</div>

I am trying to re-index asynchronously using high level rest client. I configured throttling using Requests Per Seconds, Source Batch Size. I am passing my ActionListener and waiting for the response from Elastic Search. But i am not receiving the response on the listener registered with async call.

My connections settings are listed below.  
Connection Timeout : 5000milliseconds  
Socket Timeout : 0  
Keep Alive : 20 minutes

I configured Kibana and observing the count of documents re-indexed. And all documents are re-indexed from source to destination but still i am not receiving response. Also it takes more than 20 minutes for re-index to complete.

Is this Keep-Alive setting a problem ? Does the connection is re-used because it is idle ?  
Not sure what else can be the problem.

Sample Code :  
ReindexRequest reindexRequest = new ReindexRequest();  
reindexRequest.setSourceIndices(sourceIndex);  
reindexRequest.setDestIndex(destIndex);  
reindexRequest.setDestPipeline(ElasticIndex.REINDEX\_PIPELINE\_ID);  
reindexRequest.setDestVersionType(VersionType.EXTERNAL);  
reindexRequest.setDestOpType("create");  
reindexRequest.setConflicts("proceed");  
reindexRequest.setSourceBatchSize(requestBatchSize);  
reindexRequest.setRequestsPerSecond(requestsPerSecond);  
reindexRequest.setMaxRetries(10);  
esClient.reindexAsync(reindexRequest, RequestOptions.DEFAULT,  
new ReIndexActionListener(this, sourceIndex, destIndex));

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 1, 2020, 10:25am UTC](https://discuss.elastic.co/t/re-index-asynchronously-with-high-level-rest-client/222038/2 "2020-04-01T10:25:37Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
