✅ SignalR Blazor Wasm Not Reliable When Deployed
ay, i got a
blazorwasm --hosted
project, where we have build a chat app.
the problem is, when deployed to azure, the chat is not working all the time, the messages are missing, randomly. also, we use a controller to inject messages, that one is also not working sometimes
this is the controller we use
5 Replies
so, basically
await _hubContext.Clients.All.SendAsync(Messages.RECEIVE, iparams.PhoneNumber, iparams.Message);
is clearly not working 100%, more like 30%I find that tough to believe, SignalR already includes its own protocols for message error detection and replaying and such
as does TCP
not that that's terribly helpful
but I'll wager there some misuse of some kind in your own code
like somehow you're not maintaining the connection properly
if you really wanna screw around, you could try swapping to gRPC, as a proof-of-concept
it is actually the official documentations code from microsoft
SignalR HubContext
Learn how to use the ASP.NET Core SignalR HubContext service for sending notifications to clients from outside a hub.
we use horizontal scaled servers, that breaks it, my bad