Esempio n. 1
0
        public void ExchangeBind(string destination, string source)
        {
            var binding = new ExchangeBinding(destination, source);

            lock (_exchangeBindings)
                _exchangeBindings.Add(binding);
        }
Esempio n. 2
0
        public void ExchangeUnbind(string destination, string source)
        {
            var binding = new ExchangeBinding(destination, source);

            lock (_exchangeBindings)
                _exchangeBindings.Remove(binding);

            try
            {
                if (_channel != null)
                {
                    _channel.ExchangeUnbind(destination, source, "");
                }
            }
            catch
            {
            }
        }
Esempio n. 3
0
        public void ExchangeBind(string destination, string source)
        {
            var binding = new ExchangeBinding(destination, source);

            lock (_exchangeBindings)
                _exchangeBindings.Add(binding);

            try
            {
                if (_channel != null)
                {
                    _channel.ExchangeDeclare(source, ExchangeType.Fanout, true, false, null);
                    _channel.ExchangeDeclare(destination, ExchangeType.Fanout, true, false, null);
                    _channel.ExchangeBind(destination, source, "");
                }
            }
            catch
            {
            }
        }
Esempio n. 4
0
        public void ExchangeBind(string destination, string source, bool destinationTemporary = false, bool sourceTemporary = false)
        {
            var binding = new ExchangeBinding(destination, source);

            lock (_bindings)
                if (!_exchangeBindings.Add(binding))
                {
                    return;
                }

            lock (_lock)
            {
                if (_channel != null)
                {
                    ExchangeDeclare(destination, destinationTemporary);
                    ExchangeDeclare(source, sourceTemporary);

                    _channel.ExchangeBind(destination, source, "");
                }
            }
        }