コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
        }
コード例 #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;
        }