Headache with RestHighLevelClient and bulkprocessor

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

Please format your code using </> icon as explained in this guide. It will make your post more readable.

Or use markdown style like:


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


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)

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