Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1327#discussion_r93070719
--- Diff:
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-processors/src/main/java/org/apache/nifi/processors/elasticsearch/PutElasticsearchHttp.java
---
@@ -321,9 +321,16 @@ public void onTrigger(final ProcessContext context,
final ProcessSession session
final Response getResponse;
try {
getResponse = sendRequestToElasticsearch(okHttpClient,
url, username, password, "PUT", requestBody);
- } catch (IllegalStateException | IOException ioe) {
- throw new ProcessException(ioe);
+ } catch (final Exception e) {
+ logger.error("Routing to {} due to exception: {}", new
Object[]{REL_FAILURE.getName(), e}, e);
+ flowFilesToTransfer.forEach((flowFileToTransfer) -> {
+ flowFileToTransfer =
session.penalize(flowFileToTransfer);
--- End diff --
Why penalize when routing to failure? My view of penalization is that it
should only be used when the flowfile failed to process at this time but if
processed again at a later time it may succeed (ie. a RETRY).
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---