public KafkaConsumerHostedService(
            ILogger <KafkaConsumerHostedService> logger,
            IServiceProvider serviceProvider,
            KafkaConsumerFactory kafkaConsumerFactory,
            DomainEventRegistry domainEventRegistry)
        {
            Console.WriteLine($"Starting event consumer.");

            _logger          = logger;
            _consumerFactory = kafkaConsumerFactory;
            _serviceProvider = serviceProvider;
            _eventRegistry   = domainEventRegistry;
        }