public void OnSubscriptionAdded(SubscriptionAdded message)
        {
            _connectionCache[message.SubscriptionId] = _cache.Connect(message.MessageName, message.EndpointUri,
                                                                      message.CorrelationId);

            if (_log.IsInfoEnabled)
            {
                _log.InfoFormat("Added: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                                message.SubscriptionId);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Adds a remote subscription to the route path or a local data or control bus
        /// </summary>
        /// <param name="message"></param>
        public void OnSubscriptionAdded(SubscriptionAdded message)
        {
            // determine whether the message should be send over the control bus
            bool isControlMessage = message.EndpointUri.IsControlAddress();

            // connect the message to the correct cache
            if (!isControlMessage)
            {
                _connectionCache[message.SubscriptionId] = _dataBusSubscriptionCache.Connect(message.MessageName,
                                                                                             message.EndpointUri, message.CorrelationId);
            }
            else
            {
                _connectionCache[message.SubscriptionId] = _controlBusSubscriptionCache.Connect(message.MessageName,
                                                                                                message.EndpointUri, message.CorrelationId);
            }

            _log.Debug(() => string.Format("Added: {0} => {1}, {2}", message.MessageName, message.EndpointUri,
                                           message.SubscriptionId));
        }