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_r333129702
##########
File path:
nifi-nar-bundles/nifi-azure-bundle/nifi-azure-processors/src/main/java/org/apache/nifi/processors/azure/eventhub/PutAzureEventHub.java
##########
@@ -131,18 +132,20 @@
return propertyDescriptors;
}
+ private ScheduledExecutorService executor;
+
@OnScheduled
public final void setupClient(final ProcessContext context) throws
ProcessException{
final String policyName =
context.getProperty(ACCESS_POLICY).getValue();
final String policyKey =
context.getProperty(POLICY_PRIMARY_KEY).getValue();
final String namespace = context.getProperty(NAMESPACE).getValue();
final String eventHubName =
context.getProperty(EVENT_HUB_NAME).getValue();
-
final int numThreads = context.getMaxConcurrentTasks();
senderQueue = new LinkedBlockingQueue<>(numThreads);
+ executor = Executors.newScheduledThreadPool(numThreads);
for (int i = 0; i < numThreads; i++) {
- final EventHubClient client = createEventHubClient(namespace,
eventHubName, policyName, policyKey);
+ final EventHubClient client = createEventHubClient(namespace,
eventHubName, policyName, policyKey, executor);
Review comment:
the use of this executor here too gives me pause. I'm not sure we're using
the nifi api correctly here if we're doing this.
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services