Partager via


AspireKafkaProducerExtensions.AddKeyedKafkaProducer Method

Definition

Overloads

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<ProducerBuilder<TKey,TValue>>)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<IServiceProvider,ProducerBuilder<TKey,TValue>>)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>, Action<ProducerBuilder<TKey,TValue>>)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>, Action<IServiceProvider,ProducerBuilder<TKey, TValue>>)

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String)

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

Applies to

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name, Action<Aspire.Confluent.Kafka.KafkaProducerSettings>? configureSettings);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaProducerSettings> -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String, configureSettings As Action(Of KafkaProducerSettings))

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

configureSettings
Action<KafkaProducerSettings>

An optional method used for customizing the KafkaProducerSettings.

Applies to

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<ProducerBuilder<TKey,TValue>>)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name, Action<Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String, configureBuilder As Action(Of ProducerBuilder(Of TKey, TValue)))

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

configureBuilder
Action<Confluent.Kafka.ProducerBuilder<TKey,TValue>>

An optional method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Applies to

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<IServiceProvider,ProducerBuilder<TKey,TValue>>)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name, Action<IServiceProvider,Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<IServiceProvider, Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String, configureBuilder As Action(Of IServiceProvider, ProducerBuilder(Of TKey, TValue)))

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

configureBuilder
Action<IServiceProvider,Confluent.Kafka.ProducerBuilder<TKey,TValue>>

An optional method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Applies to

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>, Action<ProducerBuilder<TKey,TValue>>)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name, Action<Aspire.Confluent.Kafka.KafkaProducerSettings>? configureSettings, Action<Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaProducerSettings> * Action<Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String, configureSettings As Action(Of KafkaProducerSettings), configureBuilder As Action(Of ProducerBuilder(Of TKey, TValue)))

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

configureSettings
Action<KafkaProducerSettings>

An optional method used for customizing the KafkaProducerSettings.

configureBuilder
Action<Confluent.Kafka.ProducerBuilder<TKey,TValue>>

An optional method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Remarks

Reads the configuration from "Aspire:Kafka:Producer:{name}" section.

Applies to

AddKeyedKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaProducerSettings>, Action<IServiceProvider,ProducerBuilder<TKey, TValue>>)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

Registers Confluent.Kafka.IProducer`2 as a keyed singleton for the given name in the services provided by the builder.

public static void AddKeyedKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string name, Action<Aspire.Confluent.Kafka.KafkaProducerSettings>? configureSettings, Action<IServiceProvider,Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKeyedKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaProducerSettings> * Action<IServiceProvider, Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKeyedKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, name As String, configureSettings As Action(Of KafkaProducerSettings), configureBuilder As Action(Of IServiceProvider, ProducerBuilder(Of TKey, TValue)))

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

name
String

The name of the component, which is used as the ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section.

configureSettings
Action<KafkaProducerSettings>

An optional method used for customizing the KafkaProducerSettings.

configureBuilder
Action<IServiceProvider,Confluent.Kafka.ProducerBuilder<TKey,TValue>>

An optional method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Remarks

Reads the configuration from "Aspire:Kafka:Producer:{name}" section.

Applies to