AspireKafkaProducerExtensions.AddKafkaProducer Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddKafkaProducer<TKey,TValue>(IHostApplicationBuilder, String)
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>)
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>>)
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>>)
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>>)
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>>)
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.