1 instantiation of ProducerConnectionFactory
Aspire.Confluent.Kafka (1)
AspireKafkaProducerExtensions.cs (1)
162
=>
new
(CreateProducerBuilder(serviceProvider, configureBuilder, settings), settings.Config);
8 references to ProducerConnectionFactory
Aspire.Confluent.Kafka (8)
AspireKafkaProducerExtensions.cs (8)
116
builder.Services.AddSingleton<
ProducerConnectionFactory
<TKey, TValue>>(sp => CreateProducerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings));
117
builder.Services.AddSingleton<IProducer<TKey, TValue>>(sp => sp.GetRequiredService<
ProducerConnectionFactory
<TKey, TValue>>().Create());
121
builder.Services.AddKeyedSingleton<
ProducerConnectionFactory
<TKey, TValue>>(serviceKey, (sp, key) => CreateProducerConnectionFactory<TKey, TValue>(sp, configureBuilder, settings));
122
builder.Services.AddKeyedSingleton<IProducer<TKey, TValue>>(serviceKey, (sp, key) => sp.GetRequiredKeyedService<
ProducerConnectionFactory
<TKey, TValue>>(key).Create());
142
var
connectionFactory = serviceKey is null
143
? sp.GetRequiredService<
ProducerConnectionFactory
<TKey, TValue>>()
144
: sp.GetRequiredKeyedService<
ProducerConnectionFactory
<TKey, TValue>>(serviceKey);
161
private static
ProducerConnectionFactory
<TKey, TValue> CreateProducerConnectionFactory<TKey, TValue>(IServiceProvider serviceProvider, Action<IServiceProvider, ProducerBuilder<TKey, TValue>>? configureBuilder, KafkaProducerSettings settings)