public Task StartAsync(CancellationToken cancellationToken)
        {
            Task.Run(() =>
            {
                using var connection = factory.CreateConnection();
                using var channel    = connection.CreateModel();

                channel.QueueDeclare(queue: "task_queue",
                                     durable: true,
                                     exclusive: false,
                                     autoDelete: false,
                                     arguments: null);

                channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);

                var consumer       = new EventingBasicConsumer(channel);
                consumer.Received += async(sender, ea) =>
                {
                    var body       = ea.Body;
                    var message    = Encoding.UTF8.GetString(body.ToArray());
                    var jsonObject = JObject.Parse(message);
                    try
                    {
                        using var scope      = scopeFactory.CreateScope();
                        var baseTokenService = scope.ServiceProvider.GetRequiredService <IBaseTokenService>();
                        var loginResult      = await authAPIClient.ApiAuthLoginPostAsync(new LoginModel
                        {
                            Login    = serviceAuthConfig.Login,
                            Password = serviceAuthConfig.Password
                        });
                        await baseTokenService.SignInAsync(loginResult);
                        await aIService.ProcessTaskAsync(JsonConvert.DeserializeObject <Request>(jsonObject["message"].ToString()));
                    }
                    catch (Exception ex)
                    {
                        logger.LogError(ex, ex.Message);
                    }
                    finally
                    {
                        channel.BasicAck(deliveryTag: ea.DeliveryTag, multiple: false);
                    }
                };
                channel.BasicConsume(queue: "task_queue",
                                     autoAck: false,
                                     consumer: consumer);
                while (!cancellationToken.IsCancellationRequested)
                {
                    ;
                }
            });
            return(Task.CompletedTask);
        }