joewitt commented on a change in pull request #3676: NIFI-6597 Azure Event Hub Version Update URL: https://github.com/apache/nifi/pull/3676#discussion_r333128767
########## File path: nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/eventhub/GetAzureEventHub.java ########## @@ -312,11 +317,13 @@ public void onScheduled(final ProcessContext context) throws ProcessException, U receiverFetchTimeout = null; } - final String connectionString = new ConnectionStringBuilder(new URI("amqps://"+namespace+serviceBusEndpoint), eventHubName, policyName, policyKey).toString(); - setupReceiver(connectionString); + final int numThreads = context.getMaxConcurrentTasks(); + executor = Executors.newScheduledThreadPool(numThreads); Review comment: We should avoid setting up an executor here at all if we can. NiFi processor API fully supports having multiple tasks/threads for a given processor and already manages the lifecycle correctly and has its own thread pool users can set important configurations of. Further, we should not do such things in onScheduled. If such a resource must be created it should be done so lazily on demand on the onTrigger method as the favored pattern. ---------------------------------------------------------------- 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: us...@infra.apache.org With regards, Apache Git Services