/// <summary>
 /// Initialize a receiver with a context and queue name
 /// </summary>
 public RabbitMqCommandReceiver(IBusContext <IConnection> context, string queueName)
 {
     Model       = context.Connection.CreateModel();
     QueueName   = queueName;
     Consumer    = new EventingBasicConsumer(Model);
     Logger      = RabbitMqLoggerFactory.CreateInstance <RabbitMqCommandReceiver>();
     ConsumerTag = Guid.NewGuid().ToString();
 }
 /// <summary>
 /// Initialize a message receiver with a context, queue name and topic filters
 /// </summary>
 public RabbitMqMessageReceiver(IBusContext <IConnection> context, string queueName, IEnumerable <string> topicFilters)
 {
     Context      = context;
     Model        = Context.Connection.CreateModel();
     QueueName    = queueName;
     TopicFilters = topicFilters;
     Consumer     = new EventingBasicConsumer(Model);
     Logger       = RabbitMqLoggerFactory.CreateInstance <RabbitMqMessageReceiver>();
     ConsumerTag  = Guid.NewGuid().ToString();
 }
예제 #3
0
 /// <summary>
 /// Initialize a builder with a logger
 /// </summary>
 public RabbitMqContextBuilder()
 {
     Logger = RabbitMqLoggerFactory.CreateInstance <RabbitMqContextBuilder>();
 }
예제 #4
0
 /// <summary>
 /// Initialize a message publisher with a bus context
 /// </summary>
 public RabbitMqMessagePublisher(IBusContext <IConnection> context)
 {
     Connection   = context.Connection;
     ExchangeName = context.ExchangeName;
     Logger       = RabbitMqLoggerFactory.CreateInstance <RabbitMqMessagePublisher>();
 }
 /// <summary>
 /// Create a new sender with a provider context
 /// </summary>
 public RabbitMqCommandSender(IBusContext <IConnection> context)
 {
     _context = context;
     _logger  = RabbitMqLoggerFactory.CreateInstance <RabbitMqCommandSender>();
 }