Степанов Дмитрий Лаб. 3 Группа 6511#156
Closed
negniy wants to merge 18 commits into
Closed
Conversation
Настройка редис и оркестрации
но наконец-то победа
Added additional images and details sections to the README.
danlla
requested changes
May 18, 2026
| @@ -0,0 +1,119 @@ | |||
| using Amazon; | |||
Comment on lines
+11
to
+14
| var builder = WebApplication.CreateBuilder(args); | ||
|
|
||
| builder.Services.AddControllers(); | ||
|
|
There was a problem hiding this comment.
Здесь не хватает builder.AddServiceDefaults();
Comment on lines
+32
to
+77
| builder.Services.AddMassTransit(x => | ||
| { | ||
| x.AddConsumer<PatientCreatedConsumer>(); | ||
|
|
||
| x.UsingAmazonSqs((context, cfg) => | ||
| { | ||
| cfg.Host( | ||
| "us-east-1", | ||
| h => | ||
| { | ||
| h.AccessKey("test"); | ||
|
|
||
| h.SecretKey("test"); | ||
|
|
||
| h.Config(new AmazonSQSConfig | ||
| { | ||
| ServiceURL = "http://localhost:4566", | ||
| AuthenticationRegion = "us-east-1", | ||
| UseHttp = true | ||
| }); | ||
|
|
||
| h.Config( | ||
| new AmazonSimpleNotificationServiceConfig | ||
| { | ||
| ServiceURL = | ||
| "http://localhost:4566", | ||
|
|
||
| AuthenticationRegion = | ||
| "us-east-1", | ||
|
|
||
| UseHttp = true | ||
| }); | ||
| }); | ||
|
|
||
| cfg.ReceiveEndpoint( | ||
| "patients-queue", | ||
| e => | ||
| { | ||
| e.ConfigureConsumeTopology = true; | ||
|
|
||
| e.ConfigureConsumer< | ||
| PatientCreatedConsumer>( | ||
| context); | ||
| }); | ||
| }); | ||
| }); |
There was a problem hiding this comment.
Если не ошибаюсь, на лекциях должно было говорится, что пользоваться MassTransit не стоит, все настроить можно без него, вот пример с лекций
Comment on lines
+18
to
+21
| public PatientIntegrationTests(AppHostFixture fixture) | ||
| { | ||
| _fixture = fixture; | ||
| } |
There was a problem hiding this comment.
В таком случае можно использовать primary constructor
Comment on lines
+9
to
+23
| var localstack = builder.AddContainer( | ||
| "localstack", | ||
| "localstack/localstack:3.7") | ||
| .WithEndpoint( | ||
| port: 4566, | ||
| targetPort: 4566, | ||
| name: "localstack", | ||
| scheme: "http") | ||
| .WithEnvironment("SERVICES", "s3,sns,sqs") | ||
| .WithEnvironment("DEFAULT_REGION", "us-east-1") | ||
| .WithEnvironment("AWS_DEFAULT_REGION", "us-east-1") | ||
| .WithEnvironment("HOSTNAME_EXTERNAL", "host.docker.internal") | ||
| .WithEnvironment( | ||
| "SNS_ENDPOINT_STRATEGY", | ||
| "off"); |
There was a problem hiding this comment.
Чтобы узнать почему тесты не проходят нужно долго и усердно отлаживать, в дебаге они вроде запускаются но падают на проверках логики
Я бы попробовал здесь явно использовать вместо контейнера пакет LocalStack.Aspire.Hosting как в примере, возможно вместе с избавление от MassTransit это починит тесты
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ФИО: Степанов Дмитрий
Номер группы: 6511
Номер лабораторной: 3
Номер варианта: 14
Краткое описание предметной области: Пациент
Краткое описание добавленных фич: Добавлена очередь сообщений и объектное хранилище.
Тесты написаны, но не проходятся насколько я понял, оно хочет, почему-то от меня какую-то лицензию, хотя руками все нормально запускается. Помогите пожалуйста😭