nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [nifi] guvencenanguvenal commented on a change in pull request #4183: NIFI-7176 - InvokeHTTP - timeout supported expression language
Date Thu, 09 Apr 2020 22:50:45 GMT
guvencenanguvenal commented on a change in pull request #4183: NIFI-7176 - InvokeHTTP - timeout
supported expression language
URL: https://github.com/apache/nifi/pull/4183#discussion_r406519400
 
 

 ##########
 File path: nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/InvokeHTTP.java
 ##########
 @@ -638,8 +637,12 @@ public void setUpClient(final ProcessContext context) throws IOException,
Unreco
         }
 
         // Set timeouts
-        okHttpClientBuilder.connectTimeout((context.getProperty(PROP_CONNECT_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue()),
TimeUnit.MILLISECONDS);
-        okHttpClientBuilder.readTimeout(context.getProperty(PROP_READ_TIMEOUT).asTimePeriod(TimeUnit.MILLISECONDS).intValue(),
TimeUnit.MILLISECONDS);
+        okHttpClientBuilder.connectTimeout((context.getProperty(PROP_CONNECT_TIMEOUT).evaluateAttributeExpressions().asTimePeriod(TimeUnit.MILLISECONDS).intValue()),
TimeUnit.MILLISECONDS);
+
+        if (context.getProperty(PROP_READ_TIMEOUT).isExpressionLanguagePresent())
+            okHttpClientBuilder.addInterceptor(new TimeoutInterceptor());
 
 Review comment:
   This interceptor set timeout for every request(if timeout is a expression language). Timeout
value is different for every request so i think there is no reason to initialize.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message