@Override
	public void onFailure(ActionRequest action, Throwable failure, int restStatusCode, RequestIndexer indexer) throws Throwable {
		if (ExceptionUtils.findThrowable(failure, EsRejectedExecutionException.class).isPresent()) {
			indexer.add(action);
		} else {
			// rethrow all other failures
			throw failure;
		}
	}
An {@link ActionRequestFailureHandler} that re-adds requests that failed due to temporary
{@link EsRejectedExecutionException}s (which means that Elasticsearch node queues are currently full),
and fails for all other failures.
elasticsearch5-xh/elasticsearch5-xh-sink/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/util/RetryRejectedExecutionFailureHandler.java