func CreateKafkaProducer(cfg *config.Config) *kafka.Producer {
	config := &kafka.ConfigMap{
		"bootstrap.servers": cfg.Kafka.Broker,
		"acks":              cfg.Producer.Acks,
		"retries":           cfg.Producer.Retries,
		"compression.type":  cfg.Producer.CompressionType,
		"client.id":         cfg.Producer.ClientID,
	}

	producer, err := kafka.NewProducer(config)
	if err != nil {
		log.Println(fmt.Sprintf("Error creating the Kafka Producer: %s", err))
	}

	return producer
}
// CreateKafkaProducer initializes and returns a Kafka Producer
CreateKafkaProducer initializes and returns a Kafka Producer
// CreateKafkaProducer initializes and returns a Kafka Producer
func CreateKafkaProducer(cfg *config.Config) *kafka.Producer {
	config := &kafka.ConfigMap{
		"bootstrap.servers": cfg.Kafka.Broker,
		"acks":              cfg.Producer.Acks,
		"retries":           cfg.Producer.Retries,
		"compression.type":  cfg.Producer.CompressionType,
		"client.id":         cfg.Producer.ClientID,
	}
	producer, err := kafka.NewProducer(config)
	if err != nil {
		log.Println(fmt.Sprintf("Error creating the Kafka Producer: %s", err))
	}
	return producer
}
func CreateKafkaProducer ( cfg * config . Config ) * kafka . Producer { config := & kafka . ConfigMap { " " : cfg . Kafka . Broker , " " : cfg . Producer . Acks , " " : cfg . Producer . Retries , " " : cfg . Producer . CompressionType , " " : cfg . Producer . ClientID , } producer , err := kafka . NewProducer ( config ) if err != nil { log . Println ( fmt . Sprintf ( " " , err ) ) } return producer }
CreateKafkaProducer initializes and returns a Kafka Producer
CreateKafkaProducer initializes and returns a Kafka Producer