/// <summary> /// Create a rabbitconsumer which will consume message from a PUBLIC exchange. This exchange is supposed to be direct/fanout (otherwise use the raw constructor) /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="exchange">the exchange you want to listen to</param> public RabbitConsumer(HareConsumerSettings settings, RabbitExchange exchange) : this(settings) { _myQueue = new RabbitQueue(GetUniqueIdentifier(exchange.Name)) { AutoDelete = true }; RedeclareMyTopology = m => { exchange.Declare(m); _myQueue.Declare(m); m.QueueBind(_myQueue.Name, exchange.Name, "noRKrequired"); }; }
private RabbitConsumer(HareConsumerSettings settings) : base(settings) { _mySettings = settings; _myConsumerTag = GetUniqueIdentifier("tag"); }
/// <summary> /// Raw constructor. You give the Queue and a handler to create the topology. Use at your own risk ! /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="queue">the queue you want to listen to. It *won't* be created, you have to create it in redeclareTopology</param> /// <param name="redeclareTopology">Construct your complete, twisted, complex topology :) </param> public RabbitConsumer(HareConsumerSettings settings, RabbitQueue queue, Action <IModel> redeclareTopology) : this(settings) { _myQueue = queue; RedeclareMyTopology = redeclareTopology; }
/// <summary> /// Create a rabbitconsumer which will consume message from a PUBLIC queue without knowing who will feed it /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="queue">the queue you want to listen to</param> public RabbitConsumer(HareConsumerSettings settings, RabbitQueue queue) : this(settings) { _myQueue = queue; RedeclareMyTopology = m => _myQueue.Declare(m); }
private RabbitConsumer(HareConsumerSettings settings) : base(settings) { _mySettings = settings; _myConsumerTag = GetUniqueIdentifier("tag"); }
/// <summary> /// Raw constructor. You give the Queue and a handler to create the topology. Use at your own risk ! /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="queue">the queue you want to listen to. It *won't* be created, you have to create it in redeclareTopology</param> /// <param name="redeclareTopology">Construct your complete, twisted, complex topology :) </param> public RabbitConsumer(HareConsumerSettings settings, RabbitQueue queue, Action<IModel> redeclareTopology) : this(settings) { _myQueue = queue; RedeclareMyTopology = redeclareTopology; }
/// <summary> /// Create a rabbitconsumer which will consume message from a PUBLIC queue without knowing who will feed it /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="queue">the queue you want to listen to</param> public RabbitConsumer(HareConsumerSettings settings, RabbitQueue queue) : this(settings) { _myQueue = queue; RedeclareMyTopology = _myQueue.Declare; }
/// <summary> /// Create a rabbitconsumer which will consume message from a PUBLIC exchange. This exchange is supposed to be direct/fanout (otherwise use the raw constructor) /// </summary> /// <param name="settings">Settings used to construct the consumer</param> /// <param name="exchange">the exchange you want to listen to</param> public RabbitConsumer(HareConsumerSettings settings, RabbitExchange exchange) : this(settings) { _myQueue = new RabbitQueue(GetUniqueIdentifier(exchange.Name)) { AutoDelete = true }; RedeclareMyTopology = m => { exchange.Declare(m); _myQueue.Declare(m); m.QueueBind(_myQueue.Name, exchange.Name, "noRKrequired"); }; }