Docs - add SQS:receive_message() (#4958)

This commit is contained in:
Bert Blommers 2022-03-21 20:58:49 -01:00 committed by GitHub
parent 47ce689cb7
commit 647c612c7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 18 deletions

View File

@ -5146,7 +5146,7 @@
## sqs ## sqs
<details> <details>
<summary>85% implemented</summary> <summary>90% implemented</summary>
- [X] add_permission - [X] add_permission
- [X] change_message_visibility - [X] change_message_visibility
@ -5161,7 +5161,7 @@
- [X] list_queue_tags - [X] list_queue_tags
- [X] list_queues - [X] list_queues
- [X] purge_queue - [X] purge_queue
- [ ] receive_message - [X] receive_message
- [X] remove_permission - [X] remove_permission
- [X] send_message - [X] send_message
- [X] send_message_batch - [X] send_message_batch

View File

@ -38,7 +38,7 @@ sqs
- [X] list_queue_tags - [X] list_queue_tags
- [X] list_queues - [X] list_queues
- [X] purge_queue - [X] purge_queue
- [ ] receive_message - [X] receive_message
- [X] remove_permission - [X] remove_permission
- [X] send_message - [X] send_message
- [X] send_message_batch - [X] send_message_batch

View File

@ -544,7 +544,7 @@ class Queue(CloudFormationModel):
your function once for each batch. When your function successfully processes your function once for each batch. When your function successfully processes
a batch, Lambda deletes its messages from the queue. a batch, Lambda deletes its messages from the queue.
""" """
messages = backend.receive_messages( messages = backend.receive_message(
self.name, self.name,
esm.batch_size, esm.batch_size,
self.receive_message_wait_time_seconds, self.receive_message_wait_time_seconds,
@ -855,7 +855,7 @@ class SQSBackend(BaseBackend):
unique_ids.add(_id) unique_ids.add(_id)
return None return None
def receive_messages( def receive_message(
self, self,
queue_name, queue_name,
count, count,
@ -863,20 +863,13 @@ class SQSBackend(BaseBackend):
visibility_timeout, visibility_timeout,
message_attribute_names=None, 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 # 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`` # "inflight" and cannot be read. We make attempts to obtain ``count``
messages but we may return less if messages are in-flight or there # messages but we may return less if messages are in-flight or there
are simple not enough messages in the queue. # 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: if message_attribute_names is None:
message_attribute_names = [] message_attribute_names = []
queue = self.get_queue(queue_name) queue = self.get_queue(queue_name)

View File

@ -423,7 +423,7 @@ class SQSResponse(BaseResponse):
except ValueError: except ValueError:
return ERROR_MAX_VISIBILITY_TIMEOUT_RESPONSE, dict(status=400) 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 queue_name, message_count, wait_time, visibility_timeout, message_attributes
) )

View File

@ -145,5 +145,6 @@ TestAccDataSourceAwsEfsMountTarget
TestAccDataSourceAWSLambdaLayerVersion TestAccDataSourceAWSLambdaLayerVersion
TestAccDataSourceAwsLambdaInvocation TestAccDataSourceAwsLambdaInvocation
TestAccDataSourceAwsNetworkInterface_ TestAccDataSourceAwsNetworkInterface_
TestAccDataSourceAwsSqsQueue
TestAccDataSourceAWSELB TestAccDataSourceAWSELB
TestValidateSSMDocumentPermissions TestValidateSSMDocumentPermissions