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


##########
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:
   Generally we want to avoid using ThreadLocal as a mechanism in NiFi though 
in this case it might be fine.  That said what is the need for a random number 
generated here?  Can we just toss out this random and have an explicit value?



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