diff --git a/IMPLEMENTATION_COVERAGE.md b/IMPLEMENTATION_COVERAGE.md index cb6254732..dd8e19fff 100644 --- a/IMPLEMENTATION_COVERAGE.md +++ b/IMPLEMENTATION_COVERAGE.md @@ -5146,7 +5146,7 @@ ## sqs
-85% implemented +90% implemented - [X] add_permission - [X] change_message_visibility @@ -5161,7 +5161,7 @@ - [X] list_queue_tags - [X] list_queues - [X] purge_queue -- [ ] receive_message +- [X] receive_message - [X] remove_permission - [X] send_message - [X] send_message_batch diff --git a/docs/docs/services/sqs.rst b/docs/docs/services/sqs.rst index ead6487df..a2eb1821f 100644 --- a/docs/docs/services/sqs.rst +++ b/docs/docs/services/sqs.rst @@ -38,7 +38,7 @@ sqs - [X] list_queue_tags - [X] list_queues - [X] purge_queue -- [ ] receive_message +- [X] receive_message - [X] remove_permission - [X] send_message - [X] send_message_batch diff --git a/moto/sqs/models.py b/moto/sqs/models.py index 6a8b10e3a..3b1a0b17b 100644 --- a/moto/sqs/models.py +++ b/moto/sqs/models.py @@ -544,7 +544,7 @@ class Queue(CloudFormationModel): your function once for each batch. When your function successfully processes a batch, Lambda deletes its messages from the queue. """ - messages = backend.receive_messages( + messages = backend.receive_message( self.name, esm.batch_size, self.receive_message_wait_time_seconds, @@ -855,7 +855,7 @@ class SQSBackend(BaseBackend): unique_ids.add(_id) return None - def receive_messages( + def receive_message( self, queue_name, count, @@ -863,20 +863,13 @@ class SQSBackend(BaseBackend): visibility_timeout, message_attribute_names=None, ): - """ - Attempt to retrieve visible messages from a queue. + # Attempt to retrieve visible messages from a queue. - If a message was read by client and not deleted it is considered to be - "inflight" and cannot be read. We make attempts to obtain ``count`` - messages but we may return less if messages are in-flight or there - are simple not enough messages in the queue. + # If a message was read by client and not deleted it is considered to be + # "inflight" and cannot be read. We make attempts to obtain ``count`` + # messages but we may return less if messages are in-flight or there + # are simple not enough messages in the queue. - :param string queue_name: The name of the queue to read from. - :param int count: The maximum amount of messages to retrieve. - :param int visibility_timeout: The number of seconds the message should remain invisible to other queue readers. - :param int wait_seconds_timeout: The duration (in seconds) for which the call waits for a message to arrive in - the queue before returning. If a message is available, the call returns sooner than WaitTimeSeconds - """ if message_attribute_names is None: message_attribute_names = [] queue = self.get_queue(queue_name) diff --git a/moto/sqs/responses.py b/moto/sqs/responses.py index 77ab9468a..ed5413fa1 100644 --- a/moto/sqs/responses.py +++ b/moto/sqs/responses.py @@ -423,7 +423,7 @@ class SQSResponse(BaseResponse): except ValueError: return ERROR_MAX_VISIBILITY_TIMEOUT_RESPONSE, dict(status=400) - messages = self.sqs_backend.receive_messages( + messages = self.sqs_backend.receive_message( queue_name, message_count, wait_time, visibility_timeout, message_attributes ) diff --git a/tests/terraform-tests.success.txt b/tests/terraform-tests.success.txt index 5cd005685..e2aea1f4f 100644 --- a/tests/terraform-tests.success.txt +++ b/tests/terraform-tests.success.txt @@ -145,5 +145,6 @@ TestAccDataSourceAwsEfsMountTarget TestAccDataSourceAWSLambdaLayerVersion TestAccDataSourceAwsLambdaInvocation TestAccDataSourceAwsNetworkInterface_ +TestAccDataSourceAwsSqsQueue TestAccDataSourceAWSELB TestValidateSSMDocumentPermissions