This repository was archived by the owner on Feb 2, 2018. It is now read-only.
remove extra check for non-existant messages array in aws response #9
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
we found that the latest aws sqs api does not return an empty Messages[] block when there are no messages in the queue. instead it returns no message body with http response code 200. we were getting errors in the log as such:
2015-04-02 21:22:37,574 [ERROR] Failed to retrieve messages from queue https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ with status_code 200: {'ResponseMetadata': {'HTTPStatusCode': 200, 'RequestId': '3b3ca2a8-5f14-5ac1-8b1f-ef3fea5dc376'}}
we validated the differences by querying via the aws cli v1.1.0:
AWS_DEFAULT_REGION=us-east-1 aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ --wait-time-seconds 2 --max-number-of-messages 1 --output json
{
"Messages": []
}
for comparison here is part of the debug response from the latest aws cli (v1.7.18):
99c90e95-aa76-5c97-9983-430cb6736cf6AWS_DEFAULT_REGION=us-east-1 aws sqs receive-message --queue-url https://sqs.us-east-1.amazonaws.com/01234567890/AbcQueue-1ABCDEFQ --wait-time-seconds 2 --max-number-of-messages 1 --output json --debug
...
2015-04-03 22:52:55,722 - MainThread - botocore.parsers - DEBUG - Response body:
...
our propsed change is just to remove the additional check, the code should proceed normally and return an empty result.