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.84.0 (build 5404dcf)", date="2023-06-19T16:30:46.838Z") @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";
 myFunction.addEventSource(SelfManagedKafkaEventSource.Builder.create()
         .bootstrapServers(bootstrapServers)
         .topic(topic)
         .secret(secret)
         .batchSize(100) // default
         .startingPosition(StartingPosition.TRIM_HORIZON)
         .build());
 
  • 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

      @Stability(Stable) public void bind(@NotNull IFunction target)
      Called by lambda.addEventSource to allow the event source to bind to this function.

      Specified by:
      bind in interface IEventSource
      Specified by:
      bind in class StreamEventSource
      Parameters:
      target - This parameter is required.