예제 #1
0
        public ClientProxy <TService> CreateProxy <TService>(string optionsName)
        {
            var options = _rabbitMQClientOptions.Get(optionsName);

            if (options.IsPropertiesDefault())
            {
                return(null);
            }

            var f           = new RabbitMQClientConnectionFactory(new SimpleOptions <RabbitMQClientOptions>(options), _loggerFactory);
            var clientProxy = new ClientProxy <TService>(f, new SimpleOptions <NetRpcClientOption>(_netRpcClientOption.CurrentValue), _serviceProvider, _loggerFactory);

            return(clientProxy);
        }
예제 #2
0
        public ClientProxy <TService>?CreateProxy <TService>(string optionsName) where TService : class
        {
            var options = _rabbitMQClientOptions.Get(optionsName);

            if (options.IsPropertiesDefault())
            {
                return(null);
            }

            var f           = new RabbitMQClientConnectionFactory(new SimpleOptions <RabbitMQClientOptions>(options), _loggerFactory);
            var clientProxy = new ClientProxy <TService>(
                f,
                new SimpleOptions <NClientOption>(_nClientOption.CurrentValue),
                _clientMiddlewareOptions,
                _actionExecutingContextAccessor,
                _serviceProvider,
                _loggerFactory);

            return(clientProxy);
        }
 public RabbitMQClientConnectionFactoryOptions(MQOptions options, ILoggerFactory loggerFactory)
 {
     Factory = new RabbitMQClientConnectionFactory(
         new SimpleOptions <RabbitMQClientOptions>(new RabbitMQClientOptions(options)), loggerFactory);
 }