You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2021/12/13 18:43:23 UTC
[nifi] 19/22: NIFI-9093 GetSplunk Processor hangs NIFI-9093 changed the required flag to false on ConnectTimeout and ReadTimeout properties
This is an automated email from the ASF dual-hosted git repository.
joewitt pushed a commit to branch support/nifi-1.15
in repository https://gitbox.apache.org/repos/asf/nifi.git
commit c7c5b6765ab0613904e1efaa5a26eab982f9cb5f
Author: ahmed shaaban <ah...@localhost.localdomain>
AuthorDate: Mon Dec 6 23:17:02 2021 +0200
NIFI-9093 GetSplunk Processor hangs
NIFI-9093 changed the required flag to false on ConnectTimeout and ReadTimeout properties
---
.../apache/nifi/processors/splunk/GetSplunk.java | 23 ++++++++++++++++++++++
1 file changed, 23 insertions(+)
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 f1721b4..58ab04f 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
@@ -65,6 +65,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;
+import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
@TriggerSerially
@@ -105,6 +106,20 @@ public class GetSplunk extends AbstractProcessor {
.addValidator(StandardValidators.PORT_VALIDATOR)
.defaultValue("8089")
.build();
+ public static final PropertyDescriptor CONNECT_TIMEOUT = new PropertyDescriptor.Builder()
+ .name("Connection Timeout")
+ .description("Max wait time for connection to the Splunk server.")
+ .required(false)
+ .defaultValue("5 secs")
+ .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
+ .build();
+ public static final PropertyDescriptor READ_TIMEOUT = new PropertyDescriptor.Builder()
+ .name("Read Timeout")
+ .description("Max wait time for response from the Splunk server.")
+ .required(false)
+ .defaultValue("15 secs")
+ .addValidator(StandardValidators.TIME_PERIOD_VALIDATOR)
+ .build();
public static final PropertyDescriptor QUERY = new PropertyDescriptor.Builder()
.name("Query")
.description("The query to execute. Typically beginning with a <search> command followed by a search clause, " +
@@ -256,6 +271,8 @@ public class GetSplunk extends AbstractProcessor {
descriptors.add(SCHEME);
descriptors.add(HOSTNAME);
descriptors.add(PORT);
+ descriptors.add(CONNECT_TIMEOUT);
+ descriptors.add(READ_TIMEOUT);
descriptors.add(QUERY);
descriptors.add(TIME_FIELD_STRATEGY);
descriptors.add(TIME_RANGE_STRATEGY);
@@ -516,6 +533,12 @@ public class GetSplunk extends AbstractProcessor {
final int port = context.getProperty(PORT).asInteger();
serviceArgs.setPort(port);
+ final int connect_timeout = context.getProperty(CONNECT_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
+ serviceArgs.add("connectTimeout",connect_timeout);
+
+ final int read_timeout = context.getProperty(READ_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue();
+ serviceArgs.add("readTimeout",read_timeout);
+
final String app = context.getProperty(APP).getValue();
if (!StringUtils.isBlank(app)) {
serviceArgs.setApp(app);