Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stateful Reconnect Support? [net8] #1878

Closed
VincentH-Net opened this issue Dec 12, 2023 · 8 comments
Closed

Stateful Reconnect Support? [net8] #1878

VincentH-Net opened this issue Dec 12, 2023 · 8 comments

Comments

@VincentH-Net
Copy link

VincentH-Net commented Dec 12, 2023

Stateful reconnect was added to SignalR in .NET 8.

Feedback on this feature (for e.g. Blazor applications) was

This feature is amazing and a must have

Multiple questions about support for this feature in Azure SignalR Service were answered in the AspNetCore SignalR repo with

Azure SignalR Service requires explicit support.

I could not find documentation / confirmation on whether this is supported.

Ask

Is stateful reconnect officially supported in Azure SignalR Service?

@VincentH-Net VincentH-Net changed the title Support Stateful Reconnect [net8] Stateful Reconnect Support? [net8] Dec 12, 2023
@vicancy
Copy link
Member

vicancy commented Dec 20, 2023

We are actively working on the support.

@vwxyzh
Copy link
Contributor

vwxyzh commented Mar 5, 2024

  • Support negotiation version 1.0 (Released)
  • Support stateful reconnect for serverless (Released)
  • Support stateful reconnect for default (Deploying)
    • SDK version >= 1.26, Target framework >= .Net Standard 2.0 (Released)
    • Service runtime (Deployed)

@VincentH-Net
Copy link
Author

VincentH-Net commented Mar 5, 2024

@vwxyzh great to see this is coming. Is the Support negotiation version 1.0 (Releasing) enough to use stateful reconnect from an AspNetCore 8 service hosted in Azure Container Apps, or does that also require Support stateful reconnect for default (Pending)?

Also, where can progress on this be tracked - this issue or somewhere else?

Thanks for your support!

@vwxyzh
Copy link
Contributor

vwxyzh commented Mar 6, 2024

@VincentH-Net Yes, it is required. Here is the document about negotiation version 1
And you can track the progress in this issue.

@vwxyzh
Copy link
Contributor

vwxyzh commented Aug 20, 2024

Blazor app requires SDK version >= 1.26.1

@SmartlyGit
Copy link

Hi, any news here? We were trying to set up Stateful reconnect with Azure signalr with this settings:

services.AddSignalR(hubOptions => {
    hubOptions.EnableDetailedErrors = false;
    hubOptions.KeepAliveInterval = TimeSpan.FromSeconds(3);
    hubOptions.HandshakeTimeout = TimeSpan.FromSeconds(10);
    hubOptions.ClientTimeoutInterval = TimeSpan.FromSeconds(15);
    hubOptions.MaximumParallelInvocationsPerClient = 1;
    hubOptions.MaximumReceiveMessageSize = 32 * 1024;
    hubOptions.StreamBufferCapacity = 10;
    hubOptions.StatefulReconnectBufferSize = 100000;
}).AddAzureSignalR(options =>
{
    options.ServerStickyMode = Microsoft.Azure.SignalR.ServerStickyMode.Required;
    options.AccessTokenLifetime = TimeSpan.FromDays(1);
    options.GracefulShutdown.Timeout = TimeSpan.FromSeconds(10);
    options.GracefulShutdown.Mode = Microsoft.Azure.SignalR.GracefulShutdownMode.MigrateClients;
    options.AllowStatefulReconnects = true;
});

and _Host:

configureSignalR: function (builder) {
    builder.withServerTimeout(15000).withKeepAliveInterval(3000).withStatefulReconnect({ bufferSize: 100000 });
}

Everything seems to be working, but we haven't seen any real change in production. However, uploading files larger than a few dozen KB is not working. I know that there is some bug related to this setting MaximumParallelInvocationsPerClient = 1; that affects file uploads, but this parameter remained in default in our case. We only tried to set up the StatefulReconnect.
53951

@vwxyzh
Copy link
Contributor

vwxyzh commented Nov 25, 2024

@SmartlyGit if the issue is still there, please open a new issue and send me (zhyan at microsoft.com) the resource id and issue time. or open a case in azure support.
this issue should be closed now.

@vwxyzh vwxyzh closed this as completed Nov 25, 2024
@jonas-nordtorp
Copy link

jonas-nordtorp commented Nov 25, 2024

If this has been resolved, the docs should probably be updated to reflect it
https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/signalr?view=aspnetcore-9.0#azure-signalr-service-with-stateful-reconnect

They still redirect to this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants