Ejemplo n.º 1
0
        public static Queue ExchangeSubscriberInstance(Exchange exchange)
        {
            Queue queue = new Queue(exchange, "", false, true, true);
            queue.Channel.QueueBind(queue.Name, exchange.Name, "");

            return queue;
        }
Ejemplo n.º 2
0
        public static Queue ExchangeSubscriberInstance(Exchange exchange, string[] routingKeys)
        {
            Queue queue = new Queue(exchange, "", false, true, true);
            if(!routingKeys.Any()) {
                queue.Channel.QueueBind(queue.Name, exchange.Name, "");
            }
            else {
                routingKeys.ForEach(routingKey => queue.Channel.QueueBind(queue.Name, exchange.Name, routingKey));
            }

            return queue;
        }
Ejemplo n.º 3
0
        public static Queue ExchangeSubscriberInstance(Exchange exchange, string[] routingKeys, bool durable,
            bool exclusive, bool autoDeleted)
        {
            Queue queue = new Queue(exchange, "", durable, exclusive, autoDeleted);
            if(!routingKeys.Any()) {
                queue.Channel.QueueBind(queue.Name, exchange.Name, "");
            }
            else {
                routingKeys.ForEach(routingKey => queue.Channel.QueueBind(queue.Name, exchange.Name, routingKey));
            }

            return queue;
        }
Ejemplo n.º 4
0
        public static Queue IndividualExchangeSubscriberInstance(Exchange exchange, string name)
        {
            AssertionConcern.NotEmpty(name, "An individual subscriber must be named.");

            Queue queue = new Queue(exchange, name, true, false, false);

            queue.Channel.QueueBind(queue.Name, exchange.Name, "");

            return queue;
        }
Ejemplo n.º 5
0
        public static Queue IndividualExchangeSubscriberInstance(Exchange exchange, string name, string[] routingKeys)
        {
            AssertionConcern.NotEmpty(name, "An individual subscriber must be named.");

            Queue queue = new Queue(exchange, name, true, false, false);

            if(!routingKeys.Any()) {
                queue.Channel.QueueBind(queue.Name, exchange.Name, "");
            }
            else {
                routingKeys.ForEach(routingKey => queue.Channel.QueueBind(queue.Name, exchange.Name, routingKey));
            }

            return queue;
        }