NIFI-8048 PutElasticsearchRecord should retry with 503 response

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #4690.
This commit is contained in:
Koji Kawamura 2020-11-26 16:26:45 +09:00 committed by Pierre Villard
parent 124cdbd3fe
commit 5ea18f39b5
No known key found for this signature in database
GPG Key ID: F92A93B30C07C6D5
1 changed files with 4 additions and 1 deletions

View File

@ -36,7 +36,10 @@ public class ElasticsearchError extends RuntimeException {
public ElasticsearchError(Exception ex) {
super(ex);
isElastic = ELASTIC_ERROR_NAMES.contains(ex.getClass().getSimpleName());
final boolean isKnownException = ELASTIC_ERROR_NAMES.contains(ex.getClass().getSimpleName());
final boolean isServiceUnavailable = "ResponseException".equals(ex.getClass().getSimpleName())
&& ex.getMessage().contains("503 Service Unavailable");
isElastic = isKnownException || isServiceUnavailable;
}
public boolean isElastic() {