nifi-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bbe...@apache.org
Subject nifi git commit: NIFI-3349 retry stale connections
Date Wed, 04 Oct 2017 16:47:43 GMT
Repository: nifi
Updated Branches:
  refs/heads/master 8741b6f6a -> 0a47a3bde


NIFI-3349 retry stale connections

This closes #2149.

Signed-off-by: Bryan Bende <bbende@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/nifi/commit/0a47a3bd
Tree: http://git-wip-us.apache.org/repos/asf/nifi/tree/0a47a3bd
Diff: http://git-wip-us.apache.org/repos/asf/nifi/diff/0a47a3bd

Branch: refs/heads/master
Commit: 0a47a3bde58ce6b07ef10c6ecd6fd9d415b76127
Parents: 8741b6f
Author: Noe <ndetore@minerkasch.com>
Authored: Tue Sep 12 14:19:11 2017 -0400
Committer: Bryan Bende <bbende@apache.org>
Committed: Wed Oct 4 12:47:28 2017 -0400

----------------------------------------------------------------------
 .../org/apache/nifi/processors/splunk/GetSplunk.java   | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/nifi/blob/0a47a3bd/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java
----------------------------------------------------------------------
diff --git a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java
b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java
index 956a653..7dbd67d 100644
--- a/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java
+++ b/nifi-nar-bundles/nifi-splunk-bundle/nifi-splunk-processors/src/main/java/org/apache/nifi/processors/splunk/GetSplunk.java
@@ -458,7 +458,18 @@ public class GetSplunk extends AbstractProcessor {
             getLogger().debug("Using index_earliest of {} and index_latest of {}", new Object[]{earliestTime,
latestTime});
         }
 
-        final InputStream exportSearch = splunkService.export(query, exportArgs);
+        InputStream export;
+        try{
+            export = splunkService.export(query, exportArgs);
+        //Catch Stale connection exception, reinitialize, and retry
+        } catch (com.splunk.HttpException e) {
+            getLogger().error("Splunk request status code:" + e.getStatus() + " Retrying
the request.");
+            splunkService.logout();
+            splunkService = createSplunkService(context);
+            export = splunkService.export(query, exportArgs);
+        }
+
+        final InputStream exportSearch = export;
 
         FlowFile flowFile = session.create();
         flowFile = session.write(flowFile, new OutputStreamCallback() {


Mime
View raw message