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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofBaseStreamEventSourceProps.getBatchSize()bisectBatchOnError(Boolean bisectBatchOnError) Sets the value ofKafkaEventSourceProps.getBisectBatchOnError()build()Builds the configured instance.consumerGroupId(String consumerGroupId) Sets the value ofKafkaEventSourceProps.getConsumerGroupId()Sets the value ofBaseStreamEventSourceProps.getEnabled()filterEncryption(IKey filterEncryption) Sets the value ofKafkaEventSourceProps.getFilterEncryption()Sets the value ofKafkaEventSourceProps.getFilters()maxBatchingWindow(Duration maxBatchingWindow) Sets the value ofBaseStreamEventSourceProps.getMaxBatchingWindow()maxRecordAge(Duration maxRecordAge) Sets the value ofKafkaEventSourceProps.getMaxRecordAge()onFailure(IEventSourceDlq onFailure) Sets the value ofKafkaEventSourceProps.getOnFailure()provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofBaseStreamEventSourceProps.getProvisionedPollerConfig()reportBatchItemFailures(Boolean reportBatchItemFailures) Sets the value ofKafkaEventSourceProps.getReportBatchItemFailures()retryAttempts(Number retryAttempts) Sets the value ofKafkaEventSourceProps.getRetryAttempts()schemaRegistryConfig(ISchemaRegistry schemaRegistryConfig) Sets the value ofKafkaEventSourceProps.getSchemaRegistryConfig()Sets the value ofKafkaEventSourceProps.getSecret()startingPosition(StartingPosition startingPosition) Sets the value ofBaseStreamEventSourceProps.getStartingPosition()startingPositionTimestamp(Number startingPositionTimestamp) Sets the value ofKafkaEventSourceProps.getStartingPositionTimestamp()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
-
bisectBatchOnError
@Stability(Stable) public KafkaEventSourceProps.Builder bisectBatchOnError(Boolean bisectBatchOnError) Sets the value ofKafkaEventSourceProps.getBisectBatchOnError()- Parameters:
bisectBatchOnError-- If the function returns an error, split the batch in two and retry.
- Returns:
this
-
consumerGroupId
Sets the value ofKafkaEventSourceProps.getConsumerGroupId()- Parameters:
consumerGroupId- The identifier for the Kafka consumer group to join. The consumer group ID must be unique among all your Kafka event sources. After creating a Kafka event source mapping with the consumer group ID specified, you cannot update this value. The value must have a length between 1 and 200 and full the pattern '[a-zA-Z0-9-/:_+=.@-]'.- Returns:
this
-
filterEncryption
Sets the value ofKafkaEventSourceProps.getFilterEncryption()- Parameters:
filterEncryption- Add Customer managed KMS key to encrypt Filter Criteria.- Returns:
this
-
filters
@Stability(Stable) public KafkaEventSourceProps.Builder filters(List<? extends Map<String, ? extends Object>> filters) Sets the value ofKafkaEventSourceProps.getFilters()- Parameters:
filters- Add filter criteria to Event Source.- Returns:
this
-
maxRecordAge
Sets the value ofKafkaEventSourceProps.getMaxRecordAge()- Parameters:
maxRecordAge- The maximum age of a record that Lambda sends to a function for processing. The default value is -1, which sets the maximum age to infinite. When the value is set to infinite, Lambda never discards old records. Record are valid until it expires in the event source.- Returns:
this
-
onFailure
Sets the value ofKafkaEventSourceProps.getOnFailure()- Parameters:
onFailure- Add an on Failure Destination for this Kafka event. Supported destinations: *KafkaDlq- Send failed records to a Kafka topic * SNS topics - Send failed records to an SNS topic * SQS queues - Send failed records to an SQS queue * S3 buckets - Send failed records to an S3 bucket- Returns:
this
-
reportBatchItemFailures
@Stability(Stable) public KafkaEventSourceProps.Builder reportBatchItemFailures(Boolean reportBatchItemFailures) Sets the value ofKafkaEventSourceProps.getReportBatchItemFailures()- Parameters:
reportBatchItemFailures-- Allow functions to return partially successful responses for a batch of records.
- Returns:
this
-
retryAttempts
Sets the value ofKafkaEventSourceProps.getRetryAttempts()- Parameters:
retryAttempts-- Maximum number of retry attempts.
- Returns:
this
-
schemaRegistryConfig
@Stability(Stable) public KafkaEventSourceProps.Builder schemaRegistryConfig(ISchemaRegistry schemaRegistryConfig) Sets the value ofKafkaEventSourceProps.getSchemaRegistryConfig()- Parameters:
schemaRegistryConfig- Specific configuration settings for a Kafka schema registry.- 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
-
startingPositionTimestamp
@Stability(Stable) public KafkaEventSourceProps.Builder startingPositionTimestamp(Number startingPositionTimestamp) Sets the value ofKafkaEventSourceProps.getStartingPositionTimestamp()- Parameters:
startingPositionTimestamp- The time from which to start reading, in Unix time seconds.- 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 for
DynamoEventSource - 10000 for
KinesisEventSource,ManagedKafkaEventSourceandSelfManagedKafkaEventSource
- 1000 for
- 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
-
provisionedPollerConfig
@Stability(Stable) public KafkaEventSourceProps.Builder provisionedPollerConfig(ProvisionedPollerConfig provisionedPollerConfig) Sets the value ofBaseStreamEventSourceProps.getProvisionedPollerConfig()- Parameters:
provisionedPollerConfig- Configuration for provisioned pollers that read from the event source. When specified, allows control over the minimum and maximum number of pollers that can be provisioned to process events from the source.- Returns:
this
-
build
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<KafkaEventSourceProps>- Returns:
- a new instance of
KafkaEventSourceProps - Throws:
NullPointerException- if any required attribute was not provided
-