コード例 #1
0
 /// <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();
 }
コード例 #2
0
 /// <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>();
 }
コード例 #5
0
 /// <summary>
 /// Create a new sender with a provider context
 /// </summary>
 public RabbitMqCommandSender(IBusContext <IConnection> context)
 {
     _context = context;
     _logger  = RabbitMqLoggerFactory.CreateInstance <RabbitMqCommandSender>();
 }