From 1d031a3101a1117fc3ffc65274c81ce33f25957e Mon Sep 17 00:00:00 2001 From: Mauro Servienti Date: Wed, 11 Oct 2023 14:12:19 +0200 Subject: [PATCH] Use wildcard format as documented by AWS to fix native integration when using localstack instead of real AWS cloud (#2289) (#2298) * Update requested MessageAttributeNames to match the wildcard in the AWS SQS docs * Adjust tests to the new wildcard format * Consistently use All --------- Co-authored-by: Maddie Hermann <46518526+maddiehermann@users.noreply.github.com> Co-authored-by: danielmarbach --- .../NativeIntegration/NativeEndpoint.cs | 2 +- src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs | 2 +- src/NServiceBus.Transport.SQS/InputQueuePump.cs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NServiceBus.Transport.SQS.AcceptanceTests/NativeIntegration/NativeEndpoint.cs b/src/NServiceBus.Transport.SQS.AcceptanceTests/NativeIntegration/NativeEndpoint.cs index f0d4311c2..e586ca644 100644 --- a/src/NServiceBus.Transport.SQS.AcceptanceTests/NativeIntegration/NativeEndpoint.cs +++ b/src/NServiceBus.Transport.SQS.AcceptanceTests/NativeIntegration/NativeEndpoint.cs @@ -28,7 +28,7 @@ public static async Task ConsumePoisonQueue(Guid testRunId, string errorQueueAdd { QueueUrl = getQueueUrlResponse.QueueUrl, WaitTimeSeconds = 5, - MessageAttributeNames = new List { "*" } + MessageAttributeNames = new List { "All" } }, cancellationToken).ConfigureAwait(false); foreach (var msg in receiveMessageResponse.Messages) diff --git a/src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs b/src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs index e8db246de..a19c02883 100644 --- a/src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs +++ b/src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs @@ -57,7 +57,7 @@ public async Task Start_loops_until_canceled() Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.MaxNumberOfMessages == 1), "MaxNumberOfMessages did not match"); Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.QueueUrl == FakeInputQueueQueueUrl), "QueueUrl did not match"); - Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.MessageAttributeNames.SequenceEqual(new List { "*" })), "MessageAttributeNames did not match"); + Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.MessageAttributeNames.SequenceEqual(new List { "All" })), "MessageAttributeNames did not match"); Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.AttributeNames.SequenceEqual(new List { "SentTimestamp" })), "AttributeNames did not match"); } diff --git a/src/NServiceBus.Transport.SQS/InputQueuePump.cs b/src/NServiceBus.Transport.SQS/InputQueuePump.cs index aaa507711..2f1789777 100644 --- a/src/NServiceBus.Transport.SQS/InputQueuePump.cs +++ b/src/NServiceBus.Transport.SQS/InputQueuePump.cs @@ -126,7 +126,7 @@ public Task StartReceive(CancellationToken cancellationToken = default) QueueUrl = inputQueueUrl, WaitTimeSeconds = 20, AttributeNames = new List { "SentTimestamp" }, - MessageAttributeNames = new List { "*" } + MessageAttributeNames = new List { "All" } }; if (coreSettings != null && coreSettings.TryGet(SettingsKeys.MessageVisibilityTimeout, out var visibilityTimeout))