Esempio n. 1
0
        public RabbitAsyncListener(IOptions <RabbitClientOptions> rabbitOptions) : base(rabbitOptions)
        {
            options = rabbitOptions.Value;

            // Buffer
            bufferBlock
                = new BufferBlock <ReadOnlyMemory <byte> >(
                      new DataflowBlockOptions()
            {
                EnsureOrdered = options.EnsureOrdered
            }
                      );
        }
        public RabbitListener(IOptions <RabbitClientOptions> rabbitOptions)
        {
            options = rabbitOptions.Value;

            // Factory
            connectionFactory = new ConnectionFactory
            {
                AutomaticRecoveryEnabled = options.AutomaticRecoveryEnabled,
                NetworkRecoveryInterval  = options.NetworkRecoveryInterval,
                HostName = options.Host,
                Password = options.Password,
                Port     = options.Port,
                Ssl      = new SslOption
                {
                    Enabled = options.SslEnabled,
                    AcceptablePolicyErrors = options.AcceptablePolicyErrors
                },
                UserName    = options.UserName,
                VirtualHost = options.VirtualHost
            };
        }