Question related to SignalR, Streams & Silo Restarts #9156
Unanswered
ctcLeonard
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I'm currently dealing with a situation and unsure on how to deal with it and am looking for some guidance.
In summary, we have an API Project and a Silo Project, the API project handles all our public endpoints and the Silo project has all our internal grain logic.
For SignalR, we are using the Microsoft.AspNetCore.SignalR package, we have configured our Hub to run on the API Project,
Whenever a client connects to our hub, we utilize GetStreamProvider within our grains to create a stream and subscribe it to a method on our Hub.
In our Grain logic, whenever we want to invoke a SignalR message for our clients, we simply utilize GetStreamProvider.GetStream with the saved ID of the stream to grab the stream, and call our function that will hit the Hub. The Hub then continues to send the data to the clients.
My Issue: Whenever our Silo restarts due to a new production build, the stream connection between our Silo & API project seems to be severed, I can call GetStreamProvider.GetStream without any exceptions being triggered, but the event never arrives in our Hub logic, which then means it never sends it to the clients either.
For the client, because the connection is between the client & the API project, it doesnt recognize this as a disconnect. Which in turns causes some issues in our business logic.
Now I am aware of projects such as https://github.com/OrleansContrib/SignalR.Orleans to implement SignalR on a Silo level instead, however this would be a very large refactor of our code.
Before I continue with that, I wanted to ask here if there any experts with any insights on this situation and could offer some alternative ways to prevent or fix this issue?
I understand that the approach of how this logic is set up may not be ideal.
Feel free to ask for any additional information if required.
Beta Was this translation helpful? Give feedback.
All reactions