# Error while posting data on ElasticSearch Index using RestyClient

**URL:** <https://discuss.elastic.co/t/error-while-posting-data-on-elasticsearch-index-using-restyclient/221668>\
**Category:** Elasticsearch\
**Created:** [March 2, 2020, 11:50am UTC](https://discuss.elastic.co/t/error-while-posting-data-on-elasticsearch-index-using-restyclient/221668 "2020-03-02T11:50:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cravinder489](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cravinder489/32/62858_2.png) [@cravinder489](https://discuss.elastic.co/u/cravinder489)\
**Post date:** [March 2, 2020, 11:50am UTC](https://discuss.elastic.co/t/error-while-posting-data-on-elasticsearch-index-using-restyclient/221668/1 "2020-03-02T11:50:36Z")

</div>

I'm posting data to my elasticsearch index using RestClient (see code below)

> JSONObject obj3 = new JSONObject();  
> obj3.put("name","question");  
> obj3.put("parent",Integer.toString(id+2));  
> JSONObject jsonObject3 = new JSONObject();  
> jsonObject3.put("body", str);  
> jsonObject3.put("title", str);  
> jsonObject3.put("qajoinfield", obj3);  
> jsonObject3.put("isvalid", "true");  
> String endpoint3 ="/idxquesanswer/\_doc/"+Integer.toString(id)+"?routing="+Integer.toString(id+2)+"&pretty";  
> HttpEntity entity3 = new NStringEntity(jsonObject3.toString() , ContentType.APPLICATION\_JSON);  
> Response indexResponse3 = restClient.performRequest("PUT",endpoint3,Collections.\<String, String\>emptyMap(),entity3);  
> System.out.println(EntityUtils.toString(indexResponse3.getEntity()));

It is showing this error:

> org.elasticsearch.client.ResponseException: method [PUT], host [[http://localhost:9200](http://localhost:9200)], URI [/idxquesanswer/\_doc/1?routing=3&pretty], status line [HTTP/1.1 429 Too Many Requests]  
> {  
> "error" : {  
> "root\_cause" : [  
> {  
> "type" : "circuit\_breaking\_exception",  
> "reason" : "[parent] Data too large, data for [\<http\_request\>] would be [1010740580/963.9mb], which is larger than the limit of [986061209/940.3mb], real usage: [1010740024/963.9mb], new bytes reserved: [556/556b]",  
> "bytes\_wanted" : 1010740580,  
> "bytes\_limit" : 986061209,  
> "durability" : "PERMANENT"  
> }  
> ],  
> "type" : "circuit\_breaking\_exception",  
> "reason" : "[parent] Data too large, data for [\<http\_request\>] would be [1010740580/963.9mb], which is larger than the limit of [986061209/940.3mb], real usage: [1010740024/963.9mb], new bytes reserved: [556/556b]",  
> "bytes\_wanted" : 1010740580,  
> "bytes\_limit" : 986061209,  
> "durability" : "PERMANENT"  
> },  
> "status" : 429  
> }

What should I do about it?

---

<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:** [March 30, 2020, 11:50am UTC](https://discuss.elastic.co/t/error-while-posting-data-on-elasticsearch-index-using-restyclient/221668/2 "2020-03-30T11:50:48Z")

</div>

Closed on March 30, 2020, 11:50am UTC

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