Base solution for your next web application
Open Closed

Issue with SignalR Chat Functionality Across Multiple Servers Using Redis Backplane #11886


User avatar
0
[email protected] created

Product version: 13.0.0 Project: ASP.NET Core MVC & jQuery

Hi,

We're currently facing an issue with implementing chat functionality using SignalR across multiple servers, with Redis serving as the backplane for communication. Here's what we've done so far:

Uncommented the relevant code in the WebCoreModule and provided the Redis connection string. Added Microsoft.AspNetCore.SignalR.StackExchangeRedis package and configured it in the Startup.cs class of our ASP.NET Core MVC project as follows:

services.AddSignalR(o => { o.EnableDetailedErrors = true; })
.AddStackExchangeRedis(_appConfiguration["Abp:RedisCache:ConnectionString"], options =>
 {
     options.Configuration.ChannelPrefix = RedisChannel.Literal("ZeroChannel");
     options.Configuration.ClientName = "VS2022";
 });

Despite these configurations, when attempting to send a message to a user, the message doesn't appear on the sender's chat screen itself.

Could you please assist us in identifying and resolving this issue? Any insights or guidance would be greatly appreciated.

Thank you!


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

    Hi,

    Do you see any error on browser console or server side log file (under App_Data folder named Logs.txt) ?

  • User Avatar
    0
    [email protected] created

    Hi,

    Do you see any error on browser console or server side log file (under App_Data folder named Logs.txt) ?

    Hi, No, I am not seeing any error in the browser console or on the Log file.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks. Are you able to see messages in the Redis ? Could you query your Redis instance and see if it is delivered ?

  • User Avatar
    0
    [email protected] created

    I am not able to see the messages in Redis. I have installed the Redis Insight app and I couldn't see the Key for messages. However, I can see the Key for Abp.RealTime.OnlineClients.Clients. I am adding the other keys that are present in the Redis database when I run the application.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Could you comment out setting ChannelPrefix and see if that works in that case ?

  • User Avatar
    0
    [email protected] created

    HI, This is my current code and it's still the same. When a sender sends messages it's not even show on his screen

    services.AddSignalR(o => { o.EnableDetailedErrors = true; }) .AddStackExchangeRedis(_appConfiguration["Abp:RedisCache:ConnectionString"], options => { options.Configuration.ClientName = "VS2022"; });

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks for the quick update. Does it work if you disable Redis only for SignalR ? If so, is it possible for us to test this in your project ?

  • User Avatar
    0
    [email protected] created

    Yes if I comment the code for Redis in EnterpriseBaseWebCoreModule, then it will work as normal.

    Yes, you can test my project.

    I havent made any changes to the source code, Just downloaded it and tried to run it.

  • User Avatar
    0
    ismcagdas created
    Support Team