Last post Oct 08, 2020 08:03 AM by test1234@4
Oct 02, 2020 02:38 PM|test1234@4|LINK
I've setup groups in signalr using a unique id. Client side, I call JoinGroup method of signalr hub using a unique id and I have that unique id on my server as well to send message to that specific group from server to client.
Now, I am executing some logic in functions app's function, on success of execution, I am sending message to that specific unique id group where the user had joint from client side and I see that message on client as well. The code to send message is setup
in business logic project where I initialize connection to signalr with the hub url of my hosted hub in web application.
Problem occurs, when the app service that contains web app scales out to more than 1 instance. Now, when the same function executes the logic, it sends multiple messages on client which is not expected. I tried handling this multiple message behavior on
client but that breaks on a specific condition of the logic so can't do that.
So, how do I troubleshoot this issue and fix it such that always a single message is sent from server/function to client.
Oct 02, 2020 03:13 PM|bruce (sqlwork.com)|LINK
if you are scaling out (more than 1 signal/r hub) be sure configured correctly.
you have the same issue with recovery. you need a persistent store (database or redis) to track sending of status messages.
Oct 02, 2020 03:47 PM|test1234@4|LINK
I am using Azure SignalR.. But still facing this issue..
Oct 02, 2020 07:49 PM|bruce (sqlwork.com)|LINK
as I stated, you need a persistent store to track the sending of messages. this is also useful, if new clients need old messages.
Oct 08, 2020 08:03 AM|test1234@4|LINK
Yes, but I can't use persistent storage as it would kill the purpose of sending the message in real time.. I tried Azure Signalr to eliminate this issue but still it is occuring.. I have turned off ARR in app service and turned on Web sockets for my web
application app service.. Is there anything else that I can do ?