public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            // Retrieve the trace manager
            var         traceManager = resolver.Resolve <ITraceManager>();
            TraceSource trace        = traceManager["SignalR." + typeof(ServiceBusMessageBus).Name];

            _connection = new ServiceBusConnection(configuration, trace);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                      .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                      .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            // Retrieve the trace manager
            var traceManager = resolver.Resolve<ITraceManager>();
            TraceSource trace = traceManager["SignalR." + typeof(ServiceBusMessageBus).Name];

            _connection = new ServiceBusConnection(configuration, trace);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                                .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                                .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
Beispiel #3
0
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _connection = new ServiceBusConnection(configuration);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                      .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                      .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }
        public ServiceBusMessageBus(IDependencyResolver resolver, ServiceBusScaleoutConfiguration configuration)
            : base(resolver, configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException("configuration");
            }

            _connection = new ServiceBusConnection(configuration);

            _topics = Enumerable.Range(0, configuration.TopicCount)
                                .Select(topicIndex => SignalRTopicPrefix + "_" + configuration.TopicPrefix + "_" + topicIndex)
                                .ToArray();

            _subscription = _connection.Subscribe(_topics, OnMessage, OnError);

            // Open the streams after creating the subscription
            for (int i = 0; i < configuration.TopicCount; i++)
            {
                Open(i);
            }
        }