For sending events to the EventHub, we can use the batch operation,
client.SendBatchAsync(eventDataList).Wait();
Each second we send 5 messages to the EventHub, we can get the batch messages from the processorProcessEventsAsyncmethod (events.Count() > 1):
publicasyncTask ProcessEventsAsync(PartitionContext context, IEnumerable<EventData> events)
{
// handle the events
await ContextCheckpointAsync(context);
}
If we use theclient.SendAsync(eventData).Wait();each second we only send one message. We will got one message from theProcessEventsAsyncmethod (events.Count() is 1).
So is there any way to get more than one events for each process (events.Count() > 1), so we can handle the events with batch operation?