Azure / azure-functions-signalrservice-extension

Azure Functions bindings for SignalR Service. Project moved to https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/signalr/Microsoft.Azure.WebJobs.Extensions.SignalRService .
MIT License
97 stars 48 forks source link

Dynamic Hubnames in Serverless SignalR Azure Functions #200

Open agravity-philipp opened 3 years ago

agravity-philipp commented 3 years ago

Hi, I managed to get an dynamic hubname for negotiation in an azure functions of this extension. But failed to have a dynamic SignalRTrigger-Hubname inside InvocationContext.

Is there a reason why this is not supported? https://github.com/Azure/azure-functions-signalrservice-extension/blob/e191a3011099049ceb6a3580a54ae2ec8dbbc2b6/src/SignalRServiceExtension/TriggerBindings/ServerlessHub.cs#L25

Or how can I use a traditional class model in an static Serverless SignalR binding like SignalRTrigger to change the listening to a specific hubName?

Does this make sense anyway if I can just have ONE upstream Azure Function per SignalR server who handles the trigger?

Apologies for my ignorance... hope someone can enlighten me.

zackliu commented 3 years ago

ServerlessHub uses the same convention as SignalR SDK, the class name is the hub name. In SignalR, Hub can be considered as a high-level isolation, different hubs usually have different methods and different logics. However, negotiation logic usually the same for different hubs. Yes, can use traditional mode for SignalRTrigger. Please see https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-signalr-service-trigger?tabs=csharp#with-traditional-model

You said

Does this make sense anyway if I can just have ONE upstream Azure Function per SignalR server who handles the trigger?

I can't get your point. You can of cause setup more than one trigger functions per function app.