Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Scaling SignalR with a backplane #1803


User avatar
0
mikek created

Hi :)

I'm trying to scale SignalR using a backplane; either Azure ServiceBus, SQL Server, or Redis.

Unfortunately, it appears that using any of the 3 above configurations breaks SignalR - the clients can't connect to the server any longer. (Connection refused or reset.)

We're using a standard Azure EventHub & configuring it in Startup.cs using a single extra line:

GlobalHost.DependencyResolver.UseServiceBus(ConfigurationManager.AppSettings["Microsoft.ServiceBus.ConnectionString"], "myAppName");
app.MapSignalR();

Commenting out the first line makes SignalR work again, but it's not scalable. :|

Is there a recommended way to configure a SignalR backplane with ABP? Thanks! :)


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Actually there is nothing special about ABP or AspNet Zero about it.

    I have tried with a newly created AspNet Zero project according to this document <a class="postlink" href="https://www.asp.net/signalr/overview/performance/scaleout-with-windows-azure-service-bus">https://www.asp.net/signalr/overview/pe ... ervice-bus</a> and connection to signalr seems fine.

    Then I tried to add a chat friend and got this error System.InvalidOperationException "The only supported IsolationLevel is 'IsolationLevel.Serializable'."

    I solved it by adding "[UnitOfWork(IsolationLevel.Serializable)]" attribute to CreateFriendshipRequestByUserName method of FriendshipAppService class.

    But after that, even a chat fiend is added to database, I couldn't get signalr response back. Still working on it :).

    By the way, do you have any exception message in client side or server side ?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    When setting

    Configuration.UnitOfWork.IsTransactional = false;
    

    in the PreInitialize of WebModule made it all working for me.

    It seems like it's not possible to use distributed transactions with this one.