1 instantiation of ConsumerConnectionFactory
Aspire.Confluent.Kafka (1)
AspireKafkaConsumerExtensions.cs (1)
162
=>
new
(CreateConsumerBuilder(serviceProvider, configureBuilder, settings), settings.Config);
8 references to ConsumerConnectionFactory
Aspire.Confluent.Kafka (8)
AspireKafkaConsumerExtensions.cs (8)
116
builder.Services.AddSingleton<
ConsumerConnectionFactory
<TKey, TValue>>(sp => CreateConsumerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings));
117
builder.Services.AddSingleton<IConsumer<TKey, TValue>>(sp => sp.GetRequiredService<
ConsumerConnectionFactory
<TKey, TValue>>().Create());
121
builder.Services.AddKeyedSingleton<
ConsumerConnectionFactory
<TKey, TValue>>(serviceKey, (sp, key) => CreateConsumerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings));
122
builder.Services.AddKeyedSingleton<IConsumer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<
ConsumerConnectionFactory
<TKey, TValue>>(key).Create());
142
var
connectionFactory = serviceKey is null
143
? sp.GetRequiredService<
ConsumerConnectionFactory
<TKey, TValue>>()
144
: sp.GetRequiredKeyedService<
ConsumerConnectionFactory
<TKey, TValue>>(serviceKey);
161
private static
ConsumerConnectionFactory
<TKey, TValue> CreateConsumerConnectionFactory<TKey, TValue>(IServiceProvider serviceProvider, Action<IServiceProvider, ConsumerBuilder<TKey, TValue>>? configureBuilder, KafkaConsumerSettings settings)