Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [FunctionName("EventHubTrigger")]
- public static async Task RunAsync([EventHubTrigger("events", Connection = "EventHub")] EventData[] eventDataSet, TraceWriter log)
- {
- log.Info($"Triggered batch of size {eventDataSet.Length}");
- foreach (var eventData in eventDataSet) {
- // For every 100th message, throw an exception
- if (int.Parse((string)eventData.Properties["counter"]) % 100 == 0)
- {
- throw new SystemException("Some exception");
- }
- // Insert the current count into Redis
- await db.ListRightPushAsync("events:" + eventData.Properties["partitionKey"], (string)eventData.Properties["counter"]);
- }
- }
Add Comment
Please, Sign In to add comment