【问题标题】:Signalr using Redis backplane not propagating messageSignalr 使用 Redis 背板不传播消息
【发布时间】:2020-07-31 03:32:47
【问题描述】:

我有一个 .net 4.5 MVC 应用程序,我最近移到了 AWS,因此我们需要在 Signalr 实现中添加一个背板。我已按照https://docs.microsoft.com/en-us/aspnet/signalr/overview/performance/scaleout-with-redis 中列出的步骤进行操作。我已经安装了 nuget 包,我当前的配置如下所示:

[assembly: OwinStartup(typeof(SignalrBootstrapper))]
namespace app
{
    public class SignalrBootstrapper
    {
        public void Configuration(IAppBuilder app)
        {
            var scaleoutConfig = new RedisScaleoutConfiguration(ConnectionStrings.Redis, "appSignalrBackplane");
            GlobalHost.DependencyResolver.UseStackExchangeRedis(scaleoutConfig);

            // Any connection or hub wire up and configuration should go here
            app.MapSignalR();
        }
    }
}

但是,它似乎不起作用。根本不再发送推送通知,我尝试使用 redis-cli 手动订阅频道,但没有发布任何内容。没有错误,我尝试手动将连接详细信息输入到UseStackExhangeRedis 函数中,而不是像链接的演示中那样使用RedisScaleoutConfiguration,但它没有帮助。

【问题讨论】:

    标签: c# asp.net-mvc redis signalr signalr-backplane


    【解决方案1】:

    最后,我找到了在 Signalr 中启用跟踪的方法: https://docs.microsoft.com/en-us/aspnet/signalr/overview/testing-and-debugging/enabling-signalr-tracing

    使用跟踪我发现加载 dll Error connecting to Redis - System.InvalidOperationException: The assembly for System.Numerics.Vectors could not be loaded 时出错,所以我添加了一个重定向到 web.config 并解决了问题

    <dependentAssembly>
        <assemblyIdentity name="System.Numerics.Vectors" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.4.0" newVersion="4.1.4.0" />
    </dependentAssembly>
    

    【讨论】:

      猜你喜欢
      • 2021-07-13
      • 2019-11-28
      • 2020-04-30
      • 2017-01-12
      • 1970-01-01
      • 2023-04-10
      • 2018-07-22
      • 2016-05-21
      • 1970-01-01
      相关资源
      最近更新 更多