mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
feat(sqs): retain MessageGroupId on standard queue messages (#1891)
* feat(sqs): retain MessageGroupId on standard queue messages Standard queues dropped MessageGroupId on SendMessage, so ReceiveMessage never returned it. Since the July 2025 fair-queues launch, standard queues accept MessageGroupId and return it as a message system attribute. Store the value in the standard-queue branch of sendMessage; both protocol handlers already parse it on send and return it on receive, covering single and batch sends. Delivery is unchanged: group locking only applies in the FIFO claim path, so same-group standard messages still deliver in parallel, matching AWS. Closes #1496 * test(sqs): give the new test a unique @Order * chore: retrigger ci
This commit is contained in:
1 parent
fcb22be76b
commit
a01b707bdc
2 files changed
+33
-1
No files matched your search
@@ -358,6 +358,36 @@ class SqsJsonProtocolTest {
|
||||
.body("Messages[0].Attributes.ApproximateFirstReceiveTimestamp", notNullValue());
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(9)
|
||||
void sendMessageToStandardQueueRetainsMessageGroupId() {
|
||||
String groupQueueName = QUEUE_NAME + "-group";
|
||||
String groupQueueUrl = given()
|
||||
.contentType(CONTENT_TYPE)
|
||||
.header("X-Amz-Target", "AmazonSQS.CreateQueue")
|
||||
.body("{\"QueueName\":\"" + groupQueueName + "\"}")
|
||||
.when().post("/").then().statusCode(200)
|
||||
.extract().jsonPath().getString("QueueUrl");
|
||||
|
||||
given()
|
||||
.contentType(CONTENT_TYPE)
|
||||
.header("X-Amz-Target", "AmazonSQS.SendMessage")
|
||||
.body("{\"QueueUrl\":\"" + groupQueueUrl + "\","
|
||||
+ "\"MessageBody\":\"fair-queues message\","
|
||||
+ "\"MessageGroupId\":\"tenant-1\"}")
|
||||
.when().post("/").then().statusCode(200);
|
||||
|
||||
given()
|
||||
.contentType(CONTENT_TYPE)
|
||||
.header("X-Amz-Target", "AmazonSQS.ReceiveMessage")
|
||||
.body("{\"QueueUrl\":\"" + groupQueueUrl + "\","
|
||||
+ "\"MaxNumberOfMessages\":1,"
|
||||
+ "\"VisibilityTimeout\":0,"
|
||||
+ "\"MessageSystemAttributeNames\":[\"MessageGroupId\"]}")
|
||||
.when().post("/").then().statusCode(200)
|
||||
.body("Messages[0].Attributes.MessageGroupId", equalTo("tenant-1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(7)
|
||||
void tagQueueWithJsonNullValueIsRejected() {
|
||||
|
||||
Reference in new issue
Block a user