public static Queue ExchangeSubscriberInstance(Exchange exchange) { Queue queue = new Queue(exchange, "", false, true, true); queue.Channel.QueueBind(queue.Name, exchange.Name, ""); return queue; }
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; }
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; }
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; }
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; }