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) (#2310)

* 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 8dc2e7f commit a8625e2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,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 Expand Up @@ -93,4 +93,4 @@ public static async Task SendTo<TEndpoint>(Dictionary<string, MessageAttributeVa
}
}
}
}
}
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 @@ -58,7 +58,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 @@ -81,7 +81,7 @@ public void Start(int maximumProcessingConcurrency, CancellationToken token)
QueueUrl = inputQueueUrl,
WaitTimeSeconds = 20,
AttributeNames = new List<string> { "SentTimestamp" },
MessageAttributeNames = new List<string> { "*" },
MessageAttributeNames = new List<string> { "All" }
};
//Set visibilitytimeout only when explicitly set by user configuration, else take the value in the queue
//users can define a custom visibility timeout only when using message driven pub/sub compatibility mode
Expand Down

0 comments on commit a8625e2

Please sign in to comment.