Exemplo n.º 1
0
        public IConnection CreateRabbitConnection(RabbitMQOptions options)
        {
            var factory = new ConnectionFactory
            {
                RequestedConnectionTimeout = 2000,
                HostName    = options.HostName,
                UserName    = options.UserName,
                Port        = options.Port,
                Password    = options.Password,
                VirtualHost = options.VirtualHost
            };

            return(factory.CreateConnection());
        }
Exemplo n.º 2
0
 public ConnectionService(ILogger <ConnectionService> logger, IOptions <RabbitMQOptions> options)
 {
     _options = options.Value;
     _logger  = logger;
 }