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
96 stars 48 forks source link

Allow users to write routing logic in function #161

Closed Y-Sindo closed 3 years ago

Y-Sindo commented 3 years ago

Changes

  1. Add an input binding "SignalREndpoints" to provide hub endpoints information.
  2. Add "Endpoints" property to "SignalRMessage" output binding to allow users to selectively send.
  3. Update "simple-chat" C# and JS function samples to demonstrate external routing.
  4. Add a "signalr-client" project to listen messages from multiple endpoints.

Testing steps in "simple-chat"

  1. Configure at least two connection string in "local.settings.json" file.
  2. Invoke the following Powershell to make HTTP requests
    • for C# sample
      Invoke-RestMethod http://localhost:7071/api/selectiveBroadcast -Method Post -Body "AnyStringContent"
    • for JS sample
      Invoke-RestMethod http://localhost:7071/api/messages -Method Post -Body "AnyStringContent"
JialinXin commented 3 years ago

Remove the client tool for self-tests. Looks it is used to skip negotiation which requires to configure connections itself. It's not suggested to make configuration in multiple places.

JialinXin commented 3 years ago

Remember to cover UTs for not setting Endpoints which is for existing customers compatibility.