Interface ActionRequestFailureHandler

  • All Superinterfaces:
    Serializable
    All Known Implementing Classes:
    IgnoringFailureHandler, NoOpFailureHandler, RetryRejectedExecutionFailureHandler

    @Deprecated
    @PublicEvolving
    public interface ActionRequestFailureHandler
    extends Serializable
    Deprecated.
    This has been deprecated and will be removed in the future.
    An implementation of 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 {
    • Method Detail

      • onFailure

        void onFailure​(org.elasticsearch.action.ActionRequest action,
                       Throwable failure,
                       int restStatusCode,
                       RequestIndexer indexer)
                throws Throwable
        Deprecated.
        Handle a failed ActionRequest.
        Parameters:
        action - the ActionRequest that failed due to the failure
        failure - the cause of failure
        restStatusCode - 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 so
        Throws:
        Throwable - if the sink should fail on this failure, the implementation should rethrow the exception or a custom one