* TP-55555 | document client and kafka integration * TP-55555 | introduce service concept refactor code * TP-55555 | s3 and kafka producer integrated and tested * TP-55555 | s3 and kafka producer integrated and tested * TP-55555 | fixed kafka for subsequent request * TP-55555 | fixed kafka for subsequent request
17 lines
437 B
Go
17 lines
437 B
Go
package kafka
|
|
|
|
import (
|
|
"cybertron/configs"
|
|
"github.com/confluentinc/confluent-kafka-go/v2/kafka"
|
|
)
|
|
|
|
func ConfluentProducer(baseConfig *configs.KafkaConfig) (*kafka.Producer, error) {
|
|
return kafka.NewProducer(&kafka.ConfigMap{
|
|
"bootstrap.servers": baseConfig.Brokers[0],
|
|
"security.protocol": "SASL_SSL",
|
|
"sasl.mechanisms": "PLAIN",
|
|
"sasl.username": baseConfig.Username,
|
|
"sasl.password": baseConfig.Password,
|
|
})
|
|
}
|