コード例 #1
0
        public async void Configure(
            IApplicationBuilder app,
            ISqsClient sqsClient,
            ISqsConsumerService sqsConsumerService,
            IActorsRepository actorsRepository,
            IMoviesRepository moviesRepository)
        {
            app.UseSerilogRequestLogging();
            app.UseRouting();
            app.UseEndpoints(endpoints =>
            {
                endpoints.MapControllers();
                endpoints.MapCustomHealthChecks("SqsReader service");
            });

            if (_appConfig.AwsQueueAutomaticallyCreate)
            {
                await sqsClient.CreateQueueAsync();
            }

            sqsConsumerService.StartConsuming();
            await actorsRepository.CreateTableAsync();

            await moviesRepository.CreateTableAsync();
        }