turcsanyip commented on code in PR #11804:
URL: https://github.com/apache/nifi/pull/11804#discussion_r4282881722


##########
nifi-extension-bundles/nifi-mqtt-bundle/nifi-mqtt-processors/src/main/java/org/apache/nifi/processors/mqtt/adapters/HiveMqV5ClientAdapter.java:
##########
@@ -157,7 +148,17 @@ public void 
setReceivedMessageHandler(ReceivedMqttMessageHandler handler) {
         });
     }
 
-    private static Mqtt5BlockingClient createClient(URI brokerUri, 
MqttClientProperties clientProperties, ComponentLog logger) throws TlsException 
{
+    private <T> T awaitWithTimeout(Future<T> future) {
+        try {
+            final T response = 
future.get(clientProperties.getConnectionTimeout(), TimeUnit.SECONDS);
+            logger.debug("Received response: {}", response);
+            return response;

Review Comment:
   I'm unsure about it, but as it is a common practice in the code base, I 
added the `interrupt()` call.



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