Share via


KafkaBuilderExtensions.AddKafka Method

Definition

Adds a Kafka resource to the application. A container is used for local development. This version the package defaults to the 7.6.1 tag of the confluentinc/confluent-local container image.

public static Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.KafkaServerResource> AddKafka (this Aspire.Hosting.IDistributedApplicationBuilder builder, string name, int? port = default);
static member AddKafka : Aspire.Hosting.IDistributedApplicationBuilder * string * Nullable<int> -> Aspire.Hosting.ApplicationModel.IResourceBuilder<Aspire.Hosting.KafkaServerResource>
<Extension()>
Public Function AddKafka (builder As IDistributedApplicationBuilder, name As String, Optional port As Nullable(Of Integer) = Nothing) As IResourceBuilder(Of KafkaServerResource)

Parameters

name
String

The name of the resource. This name will be used as the connection string name when referenced in a dependency

port
Nullable<Int32>

The host port of Kafka broker.

Returns

A reference to the IResourceBuilder<T>.

Applies to