2
votes

signalR hubs on multiple servers cannot communicate

I'm working here as an example: https://docs.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();
    }
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
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

1 Answers

-1
votes

solution names must be the same