次の方法で共有


AspireKafkaProducerExtensions.AddKafkaProducer Method

Definition

Overloads

AddKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String)

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

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

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

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

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

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

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

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

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

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

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

AddKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String)

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

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

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

connectionName
String

A name used to retrieve the connection string from the ConnectionStrings configuration section.

Applies to

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

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

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

Type Parameters

TKey
TValue

Parameters

builder
IHostApplicationBuilder

The IHostApplicationBuilder to read config from and add services to.

connectionName
String

A name used to retrieve the connection string from the ConnectionStrings configuration section.

configureSettings
Action<KafkaProducerSettings>

An optional method used for customizing the KafkaProducerSettings.

Applies to

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

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

public static void AddKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName 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.

connectionName
String

A name used to retrieve the connection string from the ConnectionStrings configuration section.

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

A method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Applies to

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

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

public static void AddKafkaProducer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<IServiceProvider,Confluent.Kafka.ProducerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaProducer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<IServiceProvider, Confluent.Kafka.ProducerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaProducer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName 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.

connectionName
String

A name used to retrieve the connection string from the ConnectionStrings configuration section.

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

A method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Applies to

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

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

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

connectionName
String

A name used 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>>

A method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Remarks

Reads the configuration from "Aspire:Kafka:Producer" section.

Applies to

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

Source:
AspireKafkaProducerExtensions.cs
Source:
AspireKafkaProducerExtensions.cs

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

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

connectionName
String

A name used 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>>

A method used for customizing the Confluent.Kafka.ProducerBuilder`2.

Remarks

Reads the configuration from "Aspire:Kafka:Producer" section.

Applies to