Class SelfManagedKafkaEventSource
Use a self hosted Kafka installation as a streaming source for AWS Lambda.
Implements
Inherited Members
Namespace: Amazon.CDK.AWS.Lambda.EventSources
Assembly: Amazon.CDK.AWS.Lambda.EventSources.dll
Syntax (csharp)
public class SelfManagedKafkaEventSource : StreamEventSource, IEventSource
Syntax (vb)
Public Class SelfManagedKafkaEventSource
Inherits StreamEventSource
Implements IEventSource
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.SecretsManager;
using Amazon.CDK.AWS.Lambda.EventSources;
// The secret that allows access to your self hosted Kafka cluster
Secret secret;
Function myFunction;
// The list of Kafka brokers
var bootstrapServers = new [] { "kafka-broker:9092" };
// The Kafka topic you want to subscribe to
var topic = "some-cool-topic";
myFunction.AddEventSource(new SelfManagedKafkaEventSource(new SelfManagedKafkaEventSourceProps {
BootstrapServers = bootstrapServers,
Topic = topic,
Secret = secret,
BatchSize = 100, // default
StartingPosition = StartingPosition.TRIM_HORIZON
}));
Synopsis
Constructors
SelfManagedKafkaEventSource(ISelfManagedKafkaEventSourceProps) | |
SelfManagedKafkaEventSource(ByRefValue) | Used by jsii to construct an instance of this class from a Javascript-owned object reference |
SelfManagedKafkaEventSource(DeputyBase.DeputyProps) | Used by jsii to construct an instance of this class from DeputyProps |
Methods
Bind(IFunction) | Called by |
Constructors
SelfManagedKafkaEventSource(ISelfManagedKafkaEventSourceProps)
public SelfManagedKafkaEventSource(ISelfManagedKafkaEventSourceProps props)
Parameters
SelfManagedKafkaEventSource(ByRefValue)
Used by jsii to construct an instance of this class from a Javascript-owned object reference
protected SelfManagedKafkaEventSource(ByRefValue reference)
Parameters
- reference Amazon.JSII.Runtime.Deputy.ByRefValue
The Javascript-owned object reference
SelfManagedKafkaEventSource(DeputyBase.DeputyProps)
Used by jsii to construct an instance of this class from DeputyProps
protected SelfManagedKafkaEventSource(DeputyBase.DeputyProps props)
Parameters
- props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps
The deputy props
Methods
Bind(IFunction)
Called by lambda.addEventSource
to allow the event source to bind to this function.
public override void Bind(IFunction target)
Parameters
- target IFunction