use of com.microsoft.azure.eventhubs.EventHubClient in project nifi by apache.
the class PutAzureEventHub method setupClient.
@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);
for (int i = 0; i < numThreads; i++) {
final EventHubClient client = createEventHubClient(namespace, eventHubName, policyName, policyKey);
if (null != client) {
senderQueue.offer(client);
}
}
}
Aggregations