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.118.0 (build 02eec31)",
date="2025-11-10T13:40:08.944Z")
@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
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forSelfManagedKafkaEventSource.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.amazon.awscdk.services.lambda.IEventSource
IEventSource.Jsii$Default -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedSelfManagedKafkaEventSource(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedSelfManagedKafkaEventSource(software.amazon.jsii.JsiiObjectRef objRef) -
Method Summary
Methods inherited from class software.amazon.awscdk.services.lambda.eventsources.StreamEventSource
enrichMappingOptions, getPropsMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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.addEventSourceto allow the event source to bind to this function.- Specified by:
bindin interfaceIEventSource- Specified by:
bindin classStreamEventSource- Parameters:
target- This parameter is required.
-