# Headache with RestHighLevelClient and bulkprocessor

**URL:** <https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 6:12pm UTC](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072 "2017-11-01T18:12:20Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Derrick](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/derrick/32/49944_2.png) [@Derrick](https://discuss.elastic.co/u/Derrick)\
**Post date:** [November 1, 2017, 6:12pm UTC](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072/1 "2017-11-01T18:12:20Z")

</div>

BulkProcessor.Builder builder = BulkProcessor.builder(client::bulkAsync, new BulkProcessorListener());

this line is complaining

The target type of this expression must be a functional interface

the error is this part: builder(client::bulkAsync,

any idea? please help

import org.elasticsearch.client.RestHighLevelClient;  
RestHighLevelClient client;

environment: java 8, eclipse

---

<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:** [November 1, 2017, 6:25pm UTC](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072/2 "2017-11-01T18:25:43Z")

</div>

Please format your code using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21). It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

I don't see the full code. But anyway here is an example:

> <https://github.com/dadoonet/fscrawler/blob/master/src/main/java/fr/pilato/elasticsearch/crawler/fs/client/ElasticsearchClientManager.java#L104-L115>

---

<div class="post-metadata">

**Author:** ![gringogordo](https://avatars.discourse-cdn.com/v4/letter/g/a87d85/32.png) [@gringogordo](https://discuss.elastic.co/u/gringogordo)\
**Post date:** [November 13, 2017, 4:17pm UTC](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072/4 "2017-11-13T16:17:41Z")

</div>

Hi,

probably not much help but I had the same error today using 5.6.3 (both low and high level). I switched to 6.0.0-rc2 and the error went away. I assume it works in 5.6.3 but it doesn't seem to want a HighLevelRestClient object but instead wants a Client. I don't pretend to understand this as I thought the Client was associated more with previous versions. Anyway I switched to 6.0.0-rc2 and it builds in line with dadoonets answer above. I can't quite understand what is needed in the Settings object though so i'm about to ask a similar question (hence finding this one)

---

<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:** [December 11, 2017, 4:17pm UTC](https://discuss.elastic.co/t/headache-with-resthighlevelclient-and-bulkprocessor/106072/5 "2017-12-11T16:17:48Z")

</div>

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