public IAmAMessageProducer Create()
        {
            var producer = new KafkaMessageProducer(_globalConfiguration, _publication);

            if (_configHook != null)
            {
                producer.ConfigHook(_configHook);
            }
            producer.Init();
            return(producer);
        }
        /// <summary>
        /// Create a message producer from tne <see cref="KafkaMessagingGatewayConfiguration"/> and <see cref="KafkaPublication"/> supplied
        /// to the constructor
        /// </summary>
        /// <returns>An <see cref="IAmAProducerRegistry"/> that represents a collection of Kafka Message Producers</returns>
        public IAmAProducerRegistry Create()
        {
            var publicationsByTopic = new Dictionary <string, IAmAMessageProducer>();

            foreach (var publication in _publications)
            {
                var producer = new KafkaMessageProducer(_globalConfiguration, publication);
                if (_configHook != null)
                {
                    producer.ConfigHook(_configHook);
                }
                producer.Init();
                publicationsByTopic[publication.Topic] = producer;
            }

            return(new ProducerRegistry(publicationsByTopic));
        }