# How to handle bulk rejections from ES in the client side

**URL:** <https://discuss.elastic.co/t/how-to-handle-bulk-rejections-from-es-in-the-client-side/124186>\
**Category:** Elasticsearch\
**Created:** [March 16, 2018, 2:31am UTC](https://discuss.elastic.co/t/how-to-handle-bulk-rejections-from-es-in-the-client-side/124186 "2018-03-16T02:31:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishekash](https://avatars.discourse-cdn.com/v4/letter/a/a88e4f/32.png) [@abhishekash](https://discuss.elastic.co/u/abhishekash)\
**Post date:** [March 16, 2018, 2:31am UTC](https://discuss.elastic.co/t/how-to-handle-bulk-rejections-from-es-in-the-client-side/124186/1 "2018-03-16T02:31:36Z")

</div>

I am using Bulk Processor for indexing using the elastic [doc](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-docs-bulk-processor.html#java-docs-bulk-processor).

and then using : bulkProcessor.add(new IndexRequest(indexName, type, id).source(json))

I am seeing high rejections with high bulk configs. Reducing these configs / increasing queue size is an option but will only work until some point. I want to have my back pressure and thus need to catch EsRejectedExecutionException and then implement my logic. But, i am not sure how to catch it.

Could some one help me here. I have followed links like [1](https://discuss.elastic.co/t/handling-esrejections-on-bulk-operations-using-transport-client/77049) , [2](https://www.elastic.co/blog/why-am-i-seeing-bulk-rejections-in-my-elasticsearch-cluster) , but have not found the answer .

---

<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 13, 2018, 2:44am UTC](https://discuss.elastic.co/t/how-to-handle-bulk-rejections-from-es-in-the-client-side/124186/2 "2018-04-13T02:44:43Z")

</div>

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