Skip to content

Commit

Permalink
Use wildcard format as documented by AWS to fix native integration wh…
Browse files Browse the repository at this point in the history
…en 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 <daniel.marbach@openplace.net>
  • Loading branch information
3 people authored Oct 11, 2023
1 parent 53769e8 commit 1d031a3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static async Task ConsumePoisonQueue(Guid testRunId, string errorQueueAdd
{
QueueUrl = getQueueUrlResponse.QueueUrl,
WaitTimeSeconds = 5,
MessageAttributeNames = new List<string> { "*" }
MessageAttributeNames = new List<string> { "All" }
}, cancellationToken).ConfigureAwait(false);

foreach (var msg in receiveMessageResponse.Messages)
Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Transport.SQS.Tests/InputQueuePumpTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> { "*" })), "MessageAttributeNames did not match");
Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.MessageAttributeNames.SequenceEqual(new List<string> { "All" })), "MessageAttributeNames did not match");
Assert.IsTrue(mockSqsClient.ReceiveMessagesRequestsSent.All(r => r.AttributeNames.SequenceEqual(new List<string> { "SentTimestamp" })), "AttributeNames did not match");
}

Expand Down
2 changes: 1 addition & 1 deletion src/NServiceBus.Transport.SQS/InputQueuePump.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public Task StartReceive(CancellationToken cancellationToken = default)
QueueUrl = inputQueueUrl,
WaitTimeSeconds = 20,
AttributeNames = new List<string> { "SentTimestamp" },
MessageAttributeNames = new List<string> { "*" }
MessageAttributeNames = new List<string> { "All" }
};

if (coreSettings != null && coreSettings.TryGet<int>(SettingsKeys.MessageVisibilityTimeout, out var visibilityTimeout))
Expand Down

0 comments on commit 1d031a3

Please sign in to comment.