The Bulk Java API supports adding a payload to each request:
The Bulk Processor supports it as well. See:
So I suppose you can add your own needed payload with that method and retrieve it with request.payloads()
Doc says that payloads are coming back in the same order as the bulk item requests:
/**
* The list of optional payloads associated with requests in the same order as the requests. Note, elements within
* it might be null if no payload has been provided.
* <p>
* Note, if no payloads have been provided, this method will return null (as to conserve memory overhead).
*/
@Nullable
public List<Object> payloads() {
return this.payloads;
}
I hope this helps.