# Issues about BulkProcessor with JAVA High Level Client

**URL:** https://discuss.elastic.co/t/issues-about-bulkprocessor-with-java-high-level-client/161168
**Category:** Elasticsearch
**Created:** [December 17, 2018, 2:20pm UTC](https://discuss.elastic.co/t/issues-about-bulkprocessor-with-java-high-level-client/161168 "2018-12-17T14:20:13Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![NikolaDai](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nikoladai/32/38954_2.png) [@NikolaDai](https://discuss.elastic.co/u/NikolaDai)
#### Post date: [December 17, 2018, 2:20pm UTC](https://discuss.elastic.co/t/issues-about-bulkprocessor-with-java-high-level-client/161168/1 "2018-12-17T14:20:13Z")

</div>

i was trying to use bulkprocessor with java high level client. I copied the demo code in [https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-bulk.html](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/current/java-rest-high-document-bulk.html).However, it tells that it can't work and shows that there is no request added to bulkrequest. then i add one more line of codes as follows

```auto
bulkRequest.add(new IndexRequest("articles", "article", String.valueOf(j)).source(lineTxt, XContentType.JSON));
bulkProcessor.add(new IndexRequest("articles", "article", String.valueOf(j)).source(lineTxt, XContentType.JSON));

```

then it works. i dont why? it is supposed that only use bulkProcessor.add which will lead to the bulkRequest's addition of new request. Anyone helps?

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [December 17, 2018, 3:06pm UTC](https://discuss.elastic.co/t/issues-about-bulkprocessor-with-java-high-level-client/161168/2 "2018-12-17T15:06:40Z")

</div>

I'm not sure I understand the question or the problem.

Anyway, here is how I'm using the bulk processor:

Create bulk processor:

> <https://github.com/dadoonet/legacy-search/blob/02-bulk/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java#L57-L77>

Save a Java bean in elasticsearch:

> <https://github.com/dadoonet/legacy-search/blob/02-bulk/src/main/java/fr/pilato/demo/legacysearch/dao/ElasticsearchDao.java#L80-L83>

Hoe this helps.

---

<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: [January 14, 2019, 3:06pm UTC](https://discuss.elastic.co/t/issues-about-bulkprocessor-with-java-high-level-client/161168/3 "2019-01-14T15:06:43Z")

</div>

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