Settings for the Redis scale-out message bus implementation.
Inheritance: Microsoft.AspNet.SignalR.Messaging.ScaleoutConfiguration
Exemplo n.º 1
0
        protected void Application_Start() {
            AreaRegistration.RegisterAllAreas();

            RedisConnectionInfo redisInfo = Settings.Current.RedisConnectionInfo;
            if (Settings.Current.EnableSignalR && redisInfo != null) {
                var config = new RedisScaleoutConfiguration(redisInfo.Host, redisInfo.Port, redisInfo.Password, "exceptionless.signalr");
                GlobalHost.DependencyResolver.UseRedis(config);
            }

            GlobalConfiguration.Configure(WebApiConfig.Register);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);
            AuthConfig.RegisterAuth();

            BundleConfig.RegisterBundles(BundleTable.Bundles);

            AutoMapperConfig.CreateMappings();

            Trace.Listeners.Add(new NLogTraceListener());
            if (ExceptionlessClient.Current.Configuration.Enabled) {
                ExceptionlessClient.Current.Log = new NLogExceptionlessLog();
                ExceptionlessClient.Current.RegisterWebApi(GlobalConfiguration.Configuration);
                ExceptionlessClient.Current.UnhandledExceptionReporting += CurrentOnUnhandledExceptionReporting;
            }

            // startup the message queue
            JobManager.Current.JobManagerStarted += (sender, args) => JobManager.Current.RunJob("StartMq");

            // make the notification sender listen for messages
            var notificationSender = DependencyResolver.Current.GetService<NotificationSender>();
            notificationSender.Listen();
        }
        /// <summary>
        /// Use Redis as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm.
        /// </summary>
        /// <param name="resolver">The dependency resolver</param>
        /// <param name="configuration">The Redis scale-out configuration options.</param> 
        /// <returns>The dependency resolver.</returns>
        public static IDependencyResolver UseRedis(this IDependencyResolver resolver, RedisScaleoutConfiguration configuration)
        {
            var bus = new Lazy<RedisMessageBus>(() => new RedisMessageBus(resolver, configuration, new RedisConnection()));
            resolver.Register(typeof(IMessageBus), () => bus.Value);

            return resolver;
        }
        /// <summary>
        /// Use Redis as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm.
        /// </summary>
        /// <param name="resolver">The dependency resolver.</param>
        /// <param name="server">The Redis server address.</param>
        /// <param name="port">The Redis server port.</param>
        /// <param name="password">The Redis server password.</param>
        /// <param name="eventKey">The Redis event key to use.</param>
        /// <returns>The dependency resolver.</returns>
        public static IDependencyResolver UseRedis(this IDependencyResolver resolver, string server, int port, string password, string eventKey)
        {
            var configuration = new RedisScaleoutConfiguration(server, port, password, eventKey);

            return UseRedis(resolver, configuration);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Use Redis, through the StackExchange.Redis client, as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm.
        /// </summary>
        /// <param name="resolver">The dependency resolver</param>
        /// <param name="configuration">The Redis scale-out configuration options.</param>
        /// <returns>The dependency resolver.</returns>
        public static IDependencyResolver UseStackExchangeRedis(this IDependencyResolver resolver, RedisScaleoutConfiguration configuration)
        {
            var bus = new Lazy <RedisMessageBus>(() => new RedisMessageBus(resolver, configuration, new RedisConnection()));

            resolver.Register(typeof(IMessageBus), () => bus.Value);

            return(resolver);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Use Redis, through the StackExchange.Redis client, as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm.
        /// </summary>
        /// <param name="resolver">The dependency resolver.</param>
        /// <param name="server">The Redis server address.</param>
        /// <param name="port">The Redis server port.</param>
        /// <param name="password">The Redis server password.</param>
        /// <param name="eventKey">The Redis event key to use.</param>
        /// <returns>The dependency resolver.</returns>
        public static IDependencyResolver UseStackExchangeRedis(this IDependencyResolver resolver, string server, int port, string password, string eventKey)
        {
            var configuration = new RedisScaleoutConfiguration(server, port, password, eventKey);

            return(UseStackExchangeRedis(resolver, configuration));
        }
Exemplo n.º 6
0
        public static IDependencyResolver UseRedis(this IDependencyResolver resolver, RedisScaleoutConfiguration configuration, bool webFarmSupport)
        {
            var bus = new Lazy <RedisMessageBus>(() => new RedisMessageBus(resolver, configuration, new RedisConnection(resolver, webFarmSupport)));

            resolver.Register(typeof(IMessageBus), () => bus.Value);

            var messageEncryptor = new MessageEncryptor();

            resolver.Register(typeof(IMessageEncryptor), () => messageEncryptor);

            return(resolver);
        }
Exemplo n.º 7
0
 /// <summary>
 /// Use Redis as the messaging backplane for scaling out of ASP.NET SignalR applications in a web farm.
 /// </summary>
 /// <param name="resolver">The dependency resolver</param>
 /// <param name="configuration">The Redis scale-out configuration options.</param>
 /// <returns>The dependency resolver.</returns>
 public static IDependencyResolver UseRedis(this IDependencyResolver resolver, RedisScaleoutConfiguration configuration)
 {
     return(UseRedis(resolver, configuration, false));
 }