You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/10/17 05:06:32 UTC

[GitHub] [nifi] JamesBirdsall commented on a change in pull request #3676: NIFI-6597 Azure Event Hub Version Update

JamesBirdsall commented on a change in pull request #3676: NIFI-6597 Azure Event Hub Version Update
URL: https://github.com/apache/nifi/pull/3676#discussion_r335811077
 
 

 ##########
 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:
   Regarding the thread pool: AMQP is not a request-response protocol. Any AMQP implementation requires the ability to process and generate network activity asynchronously from anything else going on in the application, so it can't just execute on the thread that calls send or receive. Executing on a thread pool supplied by the application is how we allow the application to have control over the thread count.
   
   As for back pressure, that's pretty simple. There is a local buffer (the "prefetch" buffer) of a user-controlled size, and the asynchronous side of the client places messages coming down from the service into that buffer, using AMQP's flow-control mechanisms to cut off the flow when the buffer is full. As the application consumes messages out of the prefetch buffer, the async side uses those flow-control mechanisms to indicate to the service that additional capacity has become available.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services