mirror of https://github.com/apache/nifi.git
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:
parent
124cdbd3fe
commit
5ea18f39b5
|
@ -36,7 +36,10 @@ public class ElasticsearchError extends RuntimeException {
|
||||||
|
|
||||||
public ElasticsearchError(Exception ex) {
|
public ElasticsearchError(Exception ex) {
|
||||||
super(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() {
|
public boolean isElastic() {
|
||||||
|
|
Loading…
Reference in New Issue