/// <summary> /// When called Event Hub receivers will be created and connect /// to Event Hub to receive events. /// </summary> /// <returns></returns> public async Task StartAsync() { // slice the pie according to distribution // this partition can get one or more assigned Event Hub Partition ids string[] EventHubPartitionIds = mEventHubClient.GetRuntimeInformation().PartitionIds; string[] ResolvedEventHubPartitionIds = mOptions.ResolveAssignedEventHubPartitions(EventHubPartitionIds); foreach (var resolvedPartition in ResolvedEventHubPartitionIds) { var rcver = new EventHubListenerPartitionReceiver(resolvedPartition, mOptions, mConsumerGroup); await rcver.StartAsync(); mReceivers.Add(rcver); } }