@PublicEvolving public interface ActionRequestFailureHandler extends Serializable
ActionRequestFailureHandler
is provided by the user to define how failed
ActionRequests
should be handled, e.g. dropping them, reprocessing malformed documents, or
simply requesting them to be sent to Elasticsearch again if the failure is only temporary.
Example:
{@code private static class ExampleActionRequestFailureHandler implements ActionRequestFailureHandler {
Modifier and Type | Method and Description |
---|---|
void |
onFailure(org.elasticsearch.action.ActionRequest action,
Throwable failure,
int restStatusCode,
RequestIndexer indexer)
Handle a failed
ActionRequest . |
void onFailure(org.elasticsearch.action.ActionRequest action, Throwable failure, int restStatusCode, RequestIndexer indexer) throws Throwable
ActionRequest
.action
- the ActionRequest
that failed due to the failurefailure
- the cause of failurerestStatusCode
- the REST status code of the failure (-1 if none can be retrieved)indexer
- request indexer to re-add the failed action, if intended to do soThrowable
- if the sink should fail on this failure, the implementation should rethrow
the exception or a custom oneCopyright © 2014–2020 The Apache Software Foundation. All rights reserved.