public void ExchangeBind(string destination, string source) { var binding = new ExchangeBinding(destination, source); lock (_exchangeBindings) _exchangeBindings.Add(binding); }
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 { } }
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 { } }
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, ""); } } }