I am following the example provided in the documentation for creating the bulk request using bulkprocessor. However, I am not sure how to pass headers to bulkAsync. I am using X-Pack and would like to send the auth header as part of the bulk request
BulkProcessor.Builder builder = BulkProcessor.builder(client::bulkAsync, listener);
builder.setBulkActions(500);
builder.setBulkSize(new ByteSizeValue(1L, ByteSizeUnit.MB));
builder.setConcurrentRequests(0);
builder.setFlushInterval(TimeValue.timeValueSeconds(10L));
builder.setBackoffPolicy(BackoffPolicy.constantBackoff(TimeValue.timeValueSeconds(1L), 3));
Documentation link - https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.1/java-rest-high-document-bulk.html
ES version - 6.1.2
Java version - 1.8