Azure / azure-functions-eventgrid-extension

EventGrid extension for Azure Functions
MIT License
48 stars 32 forks source link

How is Event Grid Triggered For Batched Messaging (Azure Functions) #114

Closed cbkrieg closed 10 hours ago

cbkrieg commented 1 year ago

How is Event Grid triggered if I want to send batched events to an Azure Function using EventGridTrigger binding?

My current infrastructure:

I would love to have Functions B and C to be triggered by ServiceBusTrigger, but it is only limited to processing 1 message at a time.

To reduce the number of times a function is called/triggered I'm wondering if I can set up EventGrid instead of ServiceBus and use EventGridTrigger binding to call a function so it can process a batched array of messages? Is this even possible? I know that you can set a max-events-per-batch and preferred-batch-size-in-kilobytes parameter, but when/what situations will functions B and C be triggered?

For example, if 400 messages are forwarded from the 3rd party service and the hit the topic at the next 2 min increment, will EventGridTrigger batch all of those messages together and send them as an array to Function A and B at that moment in time?