Class SqsEventSource.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.eventsources.SqsEventSource.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<SqsEventSource>
- Enclosing class:
SqsEventSource
@Stability(Stable)
public static final class SqsEventSource.Builder
extends Object
implements software.amazon.jsii.Builder<SqsEventSource>
A fluent builder for
SqsEventSource
.-
Method Summary
Modifier and TypeMethodDescriptionThe largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.build()
static SqsEventSource.Builder
If the SQS event source mapping should be enabled.maxBatchingWindow
(Duration maxBatchingWindow) The maximum amount of time to gather records before invoking the function.reportBatchItemFailures
(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.
-
Method Details
-
create
- Parameters:
queue
- This parameter is required.- Returns:
- a new instance of
SqsEventSource.Builder
.
-
batchSize
The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function.Your function receives an event with all the retrieved records.
Valid Range: Minimum value of 1. Maximum value of 10. If
maxBatchingWindow
is configured, this value can go up to 10,000.Default: 10
- Parameters:
batchSize
- The largest number of records that AWS Lambda will retrieve from your event source at the time of invoking your function. This parameter is required.- Returns:
this
-
enabled
If the SQS event source mapping should be enabled.Default: true
- Parameters:
enabled
- If the SQS event source mapping should be enabled. This parameter is required.- Returns:
this
-
maxBatchingWindow
The maximum amount of time to gather records before invoking the function.Valid Range: Minimum value of 0 minutes. Maximum value of 5 minutes.
Default: - no batching window. The lambda function will be invoked immediately with the records that are available.
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. This parameter is required.- Returns:
this
-
reportBatchItemFailures
@Stability(Stable) public SqsEventSource.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Allow functions to return partially successful responses for a batch of records.Default: false
- Parameters:
reportBatchItemFailures
- Allow functions to return partially successful responses for a batch of records. This parameter is required.- Returns:
this
- See Also:
-
build
- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<SqsEventSource>
- Returns:
- a newly built instance of
SqsEventSource
.
-