Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -445,10 +445,10 @@ class AmazonJavaSdkTestSuite extends SqsClientServerCommunication with Matchers
client.sendMessage(new SendMessageRequest(fifoQueueUrl, "A body"))
)

// Regular queues don't allow message groups
assertInvalidParameterQueueTypeException("MessageGroupId")(
client.sendMessage(new SendMessageRequest(regularQueueUrl, "A body").withMessageGroupId("group-1"))
)
// Regular queues now allow message groups
// Test that sending MessageGroupId to regular queue works
val result = client.sendMessage(new SendMessageRequest(regularQueueUrl, "A body").withMessageGroupId("group-1"))
result should not be null
}

test("FIFO queues do not support delaying individual messages") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,14 @@ trait SendMessageDirectives {
.fold(error => throw SQSException.invalidAttributeValue("MessageBody", Some(error)), identity)

val messageGroupId = parameters.MessageGroupId match {
// MessageGroupId is only supported for FIFO queues
case Some(v) if !queueData.isFifo => throw SQSException.invalidQueueTypeParameter(MessageGroupIdParameter)

// MessageGroupId is required for FIFO queues
case None if queueData.isFifo => throw SQSException.missingParameter(MessageGroupIdParameter)

// Ensure the given value is valid
// Ensure the given value is valid (for both FIFO and standard queues)
case Some(id) if !isValidFifoPropertyValue(id) =>
throw SQSException.invalidAlphanumericalPunctualParameterValue(MessageGroupIdParameter)

// This must be a correct value (or this isn't a FIFO queue and no value is required)
// This must be a correct value or None
case m => m
}

Expand Down