Class SelfManagedKafkaEventSource
java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.lambda.eventsources.StreamEventSource
software.amazon.awscdk.services.lambda.eventsources.SelfManagedKafkaEventSource
- All Implemented Interfaces:
IEventSource
,software.amazon.jsii.JsiiSerializable
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:04.022Z")
@Stability(Stable)
public class SelfManagedKafkaEventSource
extends StreamEventSource
Use a self hosted Kafka installation as a streaming source for AWS Lambda.
Example:
import software.amazon.awscdk.services.secretsmanager.Secret; import software.amazon.awscdk.services.lambda.eventsources.SelfManagedKafkaEventSource; // The secret that allows access to your self hosted Kafka cluster Secret secret; Function myFunction; // The list of Kafka brokers String[] bootstrapServers = List.of("kafka-broker:9092"); // The Kafka topic you want to subscribe to String topic = "some-cool-topic"; // (Optional) The consumer group id to use when connecting to the Kafka broker. If omitted the UUID of the event source mapping will be used. String consumerGroupId = "my-consumer-group-id"; myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create() .bootstrapServers(bootstrapServers) .topic(topic) .consumerGroupId(consumerGroupId) .secret(secret) .batchSize(100) // default .startingPosition(StartingPosition.TRIM_HORIZON) .build());
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forSelfManagedKafkaEventSource
.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IEventSource
IEventSource.Jsii$Default
-
Constructor Summary
ModifierConstructorDescriptionprotected
SelfManagedKafkaEventSource
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
SelfManagedKafkaEventSource
(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.lambda.eventsources.StreamEventSource
enrichMappingOptions, getProps
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Constructor Details
-
SelfManagedKafkaEventSource
protected SelfManagedKafkaEventSource(software.amazon.jsii.JsiiObjectRef objRef) -
SelfManagedKafkaEventSource
protected SelfManagedKafkaEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
SelfManagedKafkaEventSource
@Stability(Stable) public SelfManagedKafkaEventSource(@NotNull SelfManagedKafkaEventSourceProps props) - Parameters:
props
- This parameter is required.
-
-
Method Details
-
bind
Called bylambda.addEventSource
to allow the event source to bind to this function.- Specified by:
bind
in interfaceIEventSource
- Specified by:
bind
in classStreamEventSource
- Parameters:
target
- This parameter is required.
-