Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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 Exception("All queues are bound automatically to the default exchange, do bind manually.");
            }

            var binding = new Binding(this, exchange, routingKeys);
            bindings.Add(binding);
        }