[
https://issues.apache.org/jira/browse/NIFI-3194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15761993#comment-15761993
]
ASF GitHub Bot commented on NIFI-3194:
--------------------------------------
Github user JPercivall commented on a diff in the pull request:
https://github.com/apache/nifi/pull/1327#discussion_r93095656
--- 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 --
Rgr. as long as there is reasoning
> PutElasticsearchHttp should route flowfiles to failure on connection errors
> ---------------------------------------------------------------------------
>
> Key: NIFI-3194
> URL: https://issues.apache.org/jira/browse/NIFI-3194
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Reporter: Matt Burgess
> Assignee: Matt Burgess
> Fix For: 1.2.0
>
>
> If PutElasticsearchHttp encounters connection errors with the specified URL
> (such as there is no server available at the specified hostname:port), a
> ProcessException is thrown and the session is rolled back.
> For other processors that accept input flow files and access a URL (such as
> PostHttp and InvokeHttp), if such an error occurs, the flow file(s) are
> routed to failure. PutElasticsearchHttp should have behavior consistent with
> the others, and if connection errors occur, any incoming flow files should be
> routed to failure.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)