tpalfy commented on code in PR #7761:
URL: https://github.com/apache/nifi/pull/7761#discussion_r1336082857


##########
nifi-nar-bundles/nifi-websocket-bundle/nifi-websocket-services-jetty/src/main/java/org/apache/nifi/websocket/jetty/JettyWebSocketClient.java:
##########
@@ -229,6 +260,11 @@ protected List<PropertyDescriptor> 
getSupportedPropertyDescriptors() {
     public void startClient(final ConfigurationContext context) throws 
Exception {
         configurationContext = context;
 
+        connectCount = 
configurationContext.getProperty(CONNECTION_ATTEMPT_COUNT).evaluateAttributeExpressions().asInteger();
+        maximumBackoffMillis = 
configurationContext.getProperty(MAXIMUM_BACKOFF_TIME).asTimePeriod(TimeUnit.MILLISECONDS);
+        initialBackoffMillis = 
configurationContext.getProperty(INITIAL_BACKOFF_TIME).asTimePeriod(TimeUnit.MILLISECONDS);
+        backoffJitterMillis = (long) (initialBackoffMillis * 
BACKOFF_JITTER_FACTOR * ThreadLocalRandom.current().nextDouble(-1, 1));

Review Comment:
   To be honest I would keep it simple.
   I wouldn't make this more complicated for the users unless really necessary.
   
   The number of connection attempts are limited by the number of timer driven 
threads and most likely the real number of concurrent attempts would be much 
lower.
   We really only need a delay and a simple hard-coded 1-2 sec should be 
suffice in my opinion. We can add a very simple jitter via a simple Random if 
we really want.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to