Пример #1
0
        public ICommunicateChannel GetChannel(PublisherContext publisherContext)
        {
            CheckConnection();

            if (!_channelPools.ContainsKey(publisherContext.ExchangeName))
            {
                var channel = new CommunicateChannel(_connection, publisherContext);

                _channelPools.TryAdd(publisherContext.ExchangeName, channel);
            }
            return _channelPools[publisherContext.ExchangeName];
        }
Пример #2
0
        public ICommunicateChannel GetChannel(ConsumerContext consumerContext)
        {
            CheckConnection();

            if (!_channelPools.ContainsKey(consumerContext.GetConsumerKey()))
            {
                var channel = new CommunicateChannel(_connection, consumerContext);

                _channelPools.TryAdd(consumerContext.GetConsumerKey(), channel);

            }
            return _channelPools[consumerContext.GetConsumerKey()];
        }