Azure / Azure/azure-functions-host

Broadcast Event Grid events to all function host instances behind the Scale Controller

Open
#8,912 1 comment 0 reactions 1 assignee Claimed by @kshyju View on GitHub
enhancement
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

I have a need for events published to a registered Function App (through an Event Hub) to be broadcast to all scaled function instances. As of right now, when the Scale Controller creates more 2 or more function instances any event sent to that 'function' is intercepted by the Scale Controller and forwarded to only of of those instances. It would be very nice to have a flag on the event saying 'broadcast', which the Scale Controller could interpret and know it needs to forward that event to all instances.

![image](https://user-images.githubusercontent.com/638568/201955097-10598e11-c01d-439b-9b6f-a205a5164fb2.png)

This is used for a nonce caching api that I've developed. Since the api request is stateless when a request comes in, it will be assigned to one of the function instances. When the event is generated it too will be assigned to one of the instances. This means there is a greater and greater chance the request will 'miss' the instance. This miss is backed by persistent storage, so nothing is lost, however the efficacy of the cache is inversely proportionate to the number of servers: 1/X. Having 10 servers there is a 10% chance the request will happen to land on the instance that registered the event.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.