public EventProducer(EventProducerOptions options, IDictionary <Type, string> messageTopics, ILogger logger)
        {
            _messageTopics = messageTopics;
            _logger        = logger;

            _producer = new Producer <string, string>(
                options.ConstructConfig(),
                new StringSerializer(Encoding.UTF8),
                new StringSerializer(Encoding.UTF8));

            _producer.OnError      += Producer_OnError;
            _producer.OnStatistics += Producer_OnStatistics;
            _producer.OnLog        += Producer_OnLog;
        }
 public static IDictionary <string, object> ConstructConfig(this EventProducerOptions options) =>
 new Dictionary <string, object>
 {
     { "bootstrap.servers", string.Join(",", options.Brokers) },
     { "statistics.interval.ms", options.StatisticsIntervalMilliseconds },
 };