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:
[email protected]


With regards,
Apache Git Services

Reply via email to