public void BindTo(IExchange exchange, params string[] routingKeys) { if(exchange == null) { throw new ArgumentNullException("exchange"); } if (routingKeys.Any(string.IsNullOrEmpty)) { throw new ArgumentException("RoutingKey is null or empty"); } if (routingKeys.Length == 0) { throw new ArgumentException("There must be at least one routingKey"); } var binding = new Binding(this, exchange, routingKeys); bindings.Add(binding); }
public void BindTo(IExchange exchange, params string[] routingKeys) { if(exchange == null) { throw new ArgumentNullException("exchange"); } if (exchange is DefaultExchange) { throw new EasyNetQException("All queues are bound automatically to the default exchange, do bind manually."); } if (routingKeys.Any(string.IsNullOrEmpty)) { throw new ArgumentException("RoutingKey is null or empty"); } if (routingKeys.Length == 0) { throw new ArgumentException("There must be at least one routingKey"); } var binding = new Binding(this, exchange, routingKeys); bindings.Add(binding); }
public virtual void BindTo(IExchange exchange, params string[] routingKeys) { Preconditions.CheckNotNull(exchange, "exchange"); Preconditions.CheckAny(routingKeys, "routingKeys", "There must be at least one routingKey"); Preconditions.CheckFalse(routingKeys.Any(string.IsNullOrEmpty), "routingKeys", "RoutingKey is null or empty"); var binding = new Binding(this, exchange, routingKeys); bindings.Add(binding); }
public void BindTo(IExchange exchange, params string[] routingKeys) { Preconditions.CheckNotNull(exchange, "exchange"); Preconditions.CheckAny(routingKeys, "routingKeys", "There must be at least one routingKey"); Preconditions.CheckFalse(routingKeys.Any(string.IsNullOrEmpty), "routingKeys", "RoutingKey is null or empty"); if (exchange is DefaultExchange) { throw new EasyNetQException("All queues are bound automatically to the default exchange, do bind manually."); } var binding = new Binding(this, exchange, routingKeys); bindings.Add(binding); }