removing auth for MSK
This commit is contained in:
@@ -3,6 +3,8 @@ package producer
|
||||
import (
|
||||
config "com.navi.medici.janus/config"
|
||||
|
||||
// "os"
|
||||
// "log"
|
||||
"time"
|
||||
"strings"
|
||||
"github.com/Shopify/sarama"
|
||||
@@ -18,12 +20,12 @@ func GetSyncProducerConfig(kafkaConfiguration config.KafkaConfigurations) *saram
|
||||
config := sarama.NewConfig()
|
||||
|
||||
// security configs
|
||||
config.Net.TLS.Enable = true
|
||||
config.Net.SASL.Enable = true
|
||||
config.Net.SASL.Handshake = true
|
||||
config.Net.SASL.Mechanism = sarama.SASLTypePlaintext
|
||||
config.Net.SASL.User = kafkaConfiguration.Sasl_User
|
||||
config.Net.SASL.Password = kafkaConfiguration.Sasl_Password
|
||||
// config.Net.TLS.Enable = true
|
||||
// config.Net.SASL.Enable = true
|
||||
// config.Net.SASL.Handshake = true
|
||||
// config.Net.SASL.Mechanism = sarama.SASLTypePlaintext
|
||||
// config.Net.SASL.User = kafkaConfiguration.Sasl_User
|
||||
// config.Net.SASL.Password = kafkaConfiguration.Sasl_Password
|
||||
|
||||
// producer configs
|
||||
// to be changed: read from config file
|
||||
@@ -43,12 +45,12 @@ func GetAsyncProducerConfig(kafkaConfiguration config.KafkaConfigurations) *sara
|
||||
config := sarama.NewConfig()
|
||||
|
||||
// security configs
|
||||
config.Net.TLS.Enable = true
|
||||
config.Net.SASL.Enable = true
|
||||
config.Net.SASL.Handshake = true
|
||||
config.Net.SASL.Mechanism = sarama.SASLTypePlaintext
|
||||
config.Net.SASL.User = kafkaConfiguration.Sasl_User
|
||||
config.Net.SASL.Password = kafkaConfiguration.Sasl_Password
|
||||
// config.Net.TLS.Enable = true
|
||||
// config.Net.SASL.Enable = true
|
||||
// config.Net.SASL.Handshake = true
|
||||
// config.Net.SASL.Mechanism = sarama.SASLTypePlaintext
|
||||
// config.Net.SASL.User = kafkaConfiguration.Sasl_User
|
||||
// config.Net.SASL.Password = kafkaConfiguration.Sasl_Password
|
||||
|
||||
// producer configs
|
||||
// to be changed: read from config file
|
||||
@@ -88,6 +90,7 @@ func GetAsyncProducer(kafkaConfiguration config.KafkaConfigurations) sarama.Asyn
|
||||
|
||||
|
||||
func InitializeProducers(kafkaConfiguration config.KafkaConfigurations) {
|
||||
// sarama.Logger = log.New(os.Stdout, "[sarama] ", log.LstdFlags)
|
||||
syncProducer = GetSyncProducer(kafkaConfiguration)
|
||||
asyncProducer = GetAsyncProducer(kafkaConfiguration)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user