Class KafkaEventSourceProps.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.eventsources.KafkaEventSourceProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<KafkaEventSourceProps>
- Enclosing interface:
KafkaEventSourceProps
@Stability(Stable)
public static final class KafkaEventSourceProps.Builder
extends Object
implements software.amazon.jsii.Builder<KafkaEventSourceProps>
A builder for
KafkaEventSourceProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the value ofBaseStreamEventSourceProps.getBatchSize()
build()
Builds the configured instance.Sets the value ofBaseStreamEventSourceProps.getEnabled()
maxBatchingWindow
(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
Sets the value ofKafkaEventSourceProps.getSecret()
startingPosition
(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
Sets the value ofKafkaEventSourceProps.getTopic()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
topic
Sets the value ofKafkaEventSourceProps.getTopic()
- Parameters:
topic
- The Kafka topic to subscribe to. This parameter is required.- Returns:
this
-
secret
Sets the value ofKafkaEventSourceProps.getSecret()
- Parameters:
secret
- The secret with the Kafka credentials, see https://docs.aws.amazon.com/msk/latest/developerguide/msk-password.html for details This field is required if your Kafka brokers are accessed over the Internet.- Returns:
this
-
startingPosition
@Stability(Stable) public KafkaEventSourceProps.Builder startingPosition(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()
- Parameters:
startingPosition
- Where to begin consuming the stream. This parameter is required.- Returns:
this
-
batchSize
Sets the value ofBaseStreamEventSourceProps.getBatchSize()
- Parameters:
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: * 1000 forDynamoEventSource
* 10000 forKinesisEventSource
,ManagedKafkaEventSource
andSelfManagedKafkaEventSource
- Returns:
this
-
enabled
Sets the value ofBaseStreamEventSourceProps.getEnabled()
- Parameters:
enabled
- If the stream event source mapping should be enabled.- Returns:
this
-
maxBatchingWindow
@Stability(Stable) public KafkaEventSourceProps.Builder maxBatchingWindow(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()
- Parameters:
maxBatchingWindow
- The maximum amount of time to gather records before invoking the function. Maximum of Duration.minutes(5)- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<KafkaEventSourceProps>
- Returns:
- a new instance of
KafkaEventSourceProps
- Throws:
NullPointerException
- if any required attribute was not provided
-