2

signalR hubs on multiple servers cannot communicate

I'm working here as an example: https://learn.microsoft.com/en-us/aspnet/core/signalr/scale?view=aspnetcore-2.2

communication is provided on a single server. redis connection pub / sub is working properly

I want to communicate on the hubs in the same projects on multiple servers

public void ConfigureServices(IServiceCollection services)
    {
        services.AddMvc();
        var signalR = services.AddSignalR();
        signalR.AddStackExchangeRedis(options =>
        {
            options.Configuration.ChannelPrefix = "ChannelName";
            options.Configuration.EndPoints.Add("127.0.0.1", 6379);
            options.Configuration.ClientName = "ClientNameSignalR";
            options.Configuration.AllowAdmin = true;
        });
    }
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
    {
        if (env.IsDevelopment())
        {
            app.UseDeveloperExceptionPage();
        }
        app.UseStaticFiles();
        app.UseSignalR(config =>
        {
            config.MapHub<MessageHub>("/message");
        });
        app.UseMvc();
    }
noja
  • 82
  • 9
  • 1
    What exactly do you mean by "signalR hubs cannot communicate"? Messages sent from one server are not delivered to clients of another? I interpret "communication is provided on a single server" that clients of each one server do receive messages sent by that server. Could you provide message sending code as well? – alpha-mouse Oct 30 '19 at 21:14
  • The name of the projects should be the same. redis adds the project name to the name of the channels. because different project names are on different channels, they cannot message. – noja Nov 08 '19 at 06:13

1 Answers1

-1

solution names must be the same

noja
  • 82
  • 9
  • What do you mean by solution names? I have two projects web and api under one solution, however, I hosted them separately, and want to communicate. – Sachin Panchal Jan 30 '20 at 11:24
  • they work properly under one solution. In order for multiple solutions to work together, they must have the same name – noja Feb 03 '20 at 08:44
  • So, is it impossible to communicate different projects? I need to communicate a Blazor Server Project with Blazor Wasm Project, but they are generating different channel :( – Diego Apr 19 '21 at 15:01