Quantcast
Channel: Service Bus forum
Viewing all articles
Browse latest Browse all 1916

How can I get batch messages from the EventHub?

$
0
0

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?


Viewing all articles
Browse latest Browse all 1916

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>