コード例 #1
0
ファイル: LogService.cs プロジェクト: giron85/FOK
        public LogService([FromServices] Dto.RabbitMQConfigurations configurations)
        {
            var factory = new ConnectionFactory()
            {
                HostName = configurations.HostName,
                Port     = configurations.Port
            };

            var connection = factory.CreateConnection();

            _channel = connection.CreateModel();

            _channel.QueueDeclare(queue: "logQueue",
                                  durable: false,
                                  exclusive: false,
                                  autoDelete: false,
                                  arguments: null);
        }
コード例 #2
0
ファイル: LogMiddleware.cs プロジェクト: RetiSpA/FOK
        public LogMiddleware(RequestDelegate next, [FromServices] Dto.RabbitMQConfigurations configurations)
        {
            _next = next;

            var factory = new ConnectionFactory()
            {
                HostName = configurations.HostName,
                Port     = configurations.Port,
                UserName = configurations.UserName,
                Password = configurations.Password
            };

            var connection = factory.CreateConnection();

            _channel = connection.CreateModel();

            _channel.QueueDeclare(queue: "logQueue",
                                  durable: false,
                                  exclusive: false,
                                  autoDelete: false,
                                  arguments: null);
        }