kafka: setup config

This commit is contained in:
Alexey Bannov 2023-02-22 21:07:29 +03:00
parent 44250c4f2f
commit f66dfbc0a8

View File

@ -49,7 +49,7 @@ public static class ServiceCollectionExtension
{ {
services.AddSingleton(typeof(ICacheNotify<>), typeof(RabbitMQCache<>)); services.AddSingleton(typeof(ICacheNotify<>), typeof(RabbitMQCache<>));
} }
else if (kafkaConfiguration != null) else if (kafkaConfiguration != null && !string.IsNullOrEmpty(kafkaConfiguration.BootstrapServers))
{ {
services.AddSingleton(typeof(ICacheNotify<>), typeof(KafkaCacheNotify<>)); services.AddSingleton(typeof(ICacheNotify<>), typeof(KafkaCacheNotify<>));
} }