-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
good first issueGood item to work on for newcomersGood item to work on for newcomers
Description
maxReceiveCount is not always converted to an integer when reading the attributes. If the redrivePolicy is set using set-attributes after the queue is created then maxReceiveCount is returned as a string. However, if the redrivePolicy is set during queue creation (i.e. using create-queue then maxReceiveCount is returned as an integer as expected.
Step to reproduce:
- create a queue
foo
awslocal sqs create-queue --queue-name foo - create a DLQ
foo-DLQ
awslocal sqs create-queue --queue-name foo-DLQ - create an
foo-attributes.jsonwith following content
{ "RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:elasticmq:000000000000:foo-DLQ\",\"maxReceiveCount\":\"10\"}" } - update queue
fooattributes
awslocal sqs set-queue-attributes --queue-url http://localhost:4576/queue/foo --attributes file://foo-attributes.json - get queue
fooattributes
awslocal sqs get-queue-attributes --queue-url http://localhost:4576/queue/foo --attribute-names All
Current result:
maxReceiveCount is returned as a string
{
"Attributes": {
"ApproximateNumberOfMessagesNotVisible": "0",
"RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:elasticmq:000000000000:foo-DLQ\",\"maxReceiveCount\":\"10\"}",
"MessageRetentionPeriod": "259200",
"ApproximateNumberOfMessagesDelayed": "0",
"MaximumMessageSize": "131072",
"CreatedTimestamp": "1574356609",
"ApproximateNumberOfMessages": "0",
"ReceiveMessageWaitTimeSeconds": "0",
"DelaySeconds": "0",
"VisibilityTimeout": "30",
"LastModifiedTimestamp": "1574356609",
"QueueArn": "arn:aws:sqs:us-east-1:000000000000:foo"
}
}
Expected behavior:
maxReceiveCount is returned as an integer
{
"Attributes": {
"ApproximateNumberOfMessagesNotVisible": "0",
"RedrivePolicy": "{\"deadLetterTargetArn\":\"arn:aws:sqs:elasticmq:000000000000:foo-DLQ\",\"maxReceiveCount\":10}",
"MessageRetentionPeriod": "259200",
"ApproximateNumberOfMessagesDelayed": "0",
"MaximumMessageSize": "131072",
"CreatedTimestamp": "1574356609",
"ApproximateNumberOfMessages": "0",
"ReceiveMessageWaitTimeSeconds": "0",
"DelaySeconds": "0",
"VisibilityTimeout": "30",
"LastModifiedTimestamp": "1574356609",
"QueueArn": "arn:aws:sqs:us-east-1:000000000000:foo"
}
}
Versions:
- affected: 0.10.3, 0.10.4, 0.10.5
- non affected: 0.9.0, 0.10.0, 0.10.2
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood item to work on for newcomersGood item to work on for newcomers