コード例 #1
0
 public ServerToUserMQClient(IRabbitMQContext rabbitMQContext, IOptions <ServerMessagesQueueConfiguration> options)
 {
     _queueConfiguration = options.Value;
     _model = rabbitMQContext.Connection.CreateModel();
     _model.ExchangeDeclare(_queueConfiguration.ExchangeName, _queueConfiguration.ExchangeType, _queueConfiguration.Durable, autoDelete: false);
     _model.QueueDeclare(_queueConfiguration.QueueName, _queueConfiguration.Durable, _queueConfiguration.Exclusive, _queueConfiguration.AutoDelete);
     _model.QueueBind(_queueConfiguration.QueueName, _queueConfiguration.ExchangeName, _queueConfiguration.RoutingKey);
 }
コード例 #2
0
 public ValuesController(ILogger <ValuesController> logger, MyRabbitMQContext context)
 {
     _logger  = logger;
     _context = context;
 }
コード例 #3
0
 public QueueService(IRabbitMQContext rabbitMQContext)
 {
     this.rabbitMQContext = rabbitMQContext;
 }