Skip to content

Commit

Permalink
docs(lambda-event-sources): remove incorrect description regarding re…
Browse files Browse the repository at this point in the history
…ceiveMessageWaitTime (#26882)

Currently, the document for aws_lambda_event_sources module includes the following description.
https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_lambda_event_sources-readme.html#sqs
> receiveMessageWaitTime: Will determine long poll duration. The default value is 20 seconds.

However, from SQS perspective, the default value is 0. So, the above description is incorrect.
https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_SetQueueAttributes.html
> ReceiveMessageWaitTimeSeconds – The length of time, in seconds, for which a ReceiveMessage action waits for a message to arrive. Valid values: An integer from 0 to 20 (seconds). Default: 0.

Also, when we use SQS queue as Lambda's source, Lambda uses long polling regardless of the queue's ReceiveMessageWaitTimeSeconds setting. 
https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-scaling
> For standard queues, Lambda uses long polling to poll a queue until it becomes active.

So, in this context, `receiveMessageWaitTime` prop for Queue construct does not affect the behavior of Lambda EventSource. To avoid confusion, this PR remove the description regarding `receiveMessageWaitTime` from document.

Closes #24795

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
tam0ri committed Aug 25, 2023
1 parent bf441fa commit 8a3db0a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions packages/aws-cdk-lib/aws-lambda-event-sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ queue parameters. The following parameters will impact Amazon SQS's polling
behavior:

* __visibilityTimeout__: May impact the period between retries.
* __receiveMessageWaitTime__: Will determine [long
poll](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-long-polling.html)
duration. The default value is 20 seconds.
* __batchSize__: Determines how many records are buffered before invoking your lambda function.
* __maxBatchingWindow__: The maximum amount of time to gather records before invoking the lambda. This increases the likelihood of a full batch at the cost of delayed processing.
* __maxConcurrency__: The maximum concurrency setting limits the number of concurrent instances of the function that an Amazon SQS event source can invoke.
Expand All @@ -62,7 +59,6 @@ import { SqsEventSource } from 'aws-cdk-lib/aws-lambda-event-sources';

const queue = new sqs.Queue(this, 'MyQueue', {
visibilityTimeout: Duration.seconds(30), // default,
receiveMessageWaitTime: Duration.seconds(20), // default
});
declare const fn: lambda.Function;

Expand Down

0 comments on commit 8a3db0a

Please sign in to comment.