Esempio n. 1
0
        private void Reset(MQOptions opt)
        {
            if (_service != null)
            {
                _service.Dispose();
                _service.ReceivedAsync -= ServiceReceivedAsync;
            }

            _service = new Service(opt.CreateConnectionFactory(), opt.RpcQueue, opt.PrefetchCount, _logger);
            _service.ReceivedAsync += ServiceReceivedAsync;
        }
Esempio n. 2
0
        private void Reset(MQOptions opt, IServiceProvider serviceProvider)
        {
            if (_service != null)
            {
                _service.Dispose();
                _service.Received -= ServiceReceived;
            }

            _service           = new Service(opt.CreateConnectionFactory(), opt.RpcQueue, opt.PrefetchCount, _logger);
            _requestHandler    = new RequestHandler(serviceProvider, ChannelType.RabbitMQ);
            _service.Received += ServiceReceived;
        }
 public RabbitMQClientConnectionFactory(IOptions <RabbitMQClientOptions> options, ILoggerFactory factory)
 {
     _logger     = factory.CreateLogger("NetRpc");
     _options    = options.Value;
     _connection = _options.CreateConnectionFactory().CreateConnection();
 }