AspireKafkaConsumerExtensions.AddKafkaConsumer 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
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string -> unit
<Extension()>
Public Sub AddKafkaConsumer(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
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaConsumerSettings>)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Aspire.Confluent.Kafka.KafkaConsumerSettings>? configureSettings);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaConsumerSettings> -> unit
<Extension()>
Public Sub AddKafkaConsumer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName As String, configureSettings As Action(Of KafkaConsumerSettings))
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<KafkaConsumerSettings>
An optional method for customizing the KafkaConsumerSettings.
Applies to
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String, Action<ConsumerBuilder<TKey,TValue>>)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Confluent.Kafka.ConsumerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Confluent.Kafka.ConsumerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaConsumer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName As String, configureBuilder As Action(Of ConsumerBuilder(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.ConsumerBuilder<TKey,TValue>>
An optional method used for customizing the Confluent.Kafka.ConsumerBuilder`2.
Applies to
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String, Action<IServiceProvider,ConsumerBuilder<TKey,TValue>>)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<IServiceProvider,Confluent.Kafka.ConsumerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<IServiceProvider, Confluent.Kafka.ConsumerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaConsumer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName As String, configureBuilder As Action(Of IServiceProvider, ConsumerBuilder(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.ConsumerBuilder<TKey,TValue>>
An optional method used for customizing the Confluent.Kafka.ConsumerBuilder`2.
Applies to
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaConsumerSettings>, Action<ConsumerBuilder<TKey,TValue>>)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Aspire.Confluent.Kafka.KafkaConsumerSettings>? configureSettings, Action<Confluent.Kafka.ConsumerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaConsumerSettings> * Action<Confluent.Kafka.ConsumerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaConsumer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName As String, configureSettings As Action(Of KafkaConsumerSettings), configureBuilder As Action(Of ConsumerBuilder(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<KafkaConsumerSettings>
An optional method for customizing the KafkaConsumerSettings.
- configureBuilder
- Action<Confluent.Kafka.ConsumerBuilder<TKey,TValue>>
An optional method used for customizing the Confluent.Kafka.ConsumerBuilder`2.
Remarks
Reads the configuration from "Aspire:Kafka:Consumer" section.
Applies to
AddKafkaConsumer<TKey,TValue>(IHostApplicationBuilder, String, Action<KafkaConsumerSettings>, Action<IServiceProvider,ConsumerBuilder<TKey,TValue>>)
Registers Confluent.Kafka.IConsumer`2 as a singleton in the services provided by the builder
.
public static void AddKafkaConsumer<TKey,TValue> (this Microsoft.Extensions.Hosting.IHostApplicationBuilder builder, string connectionName, Action<Aspire.Confluent.Kafka.KafkaConsumerSettings>? configureSettings, Action<IServiceProvider,Confluent.Kafka.ConsumerBuilder<TKey,TValue>>? configureBuilder);
static member AddKafkaConsumer : Microsoft.Extensions.Hosting.IHostApplicationBuilder * string * Action<Aspire.Confluent.Kafka.KafkaConsumerSettings> * Action<IServiceProvider, Confluent.Kafka.ConsumerBuilder<'Key, 'Value>> -> unit
<Extension()>
Public Sub AddKafkaConsumer(Of TKey, TValue) (builder As IHostApplicationBuilder, connectionName As String, configureSettings As Action(Of KafkaConsumerSettings), configureBuilder As Action(Of IServiceProvider, ConsumerBuilder(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<KafkaConsumerSettings>
An optional method for customizing the KafkaConsumerSettings.
- configureBuilder
- Action<IServiceProvider,Confluent.Kafka.ConsumerBuilder<TKey,TValue>>
An optional method used for customizing the Confluent.Kafka.ConsumerBuilder`2.
Remarks
Reads the configuration from "Aspire:Kafka:Consumer" section.