mirror of https://github.com/apache/nifi.git
NIFI-3349 retry stale connections
This closes #2149. Signed-off-by: Bryan Bende <bbende@apache.org>
This commit is contained in:
parent
8741b6f6a5
commit
0a47a3bde5
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue