You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// // Provide the SCRAM client generator function
config.Net.SASL.SCRAMClientGeneratorFunc = func() sarama.SCRAMClient {
// Create and return a custom SCRAM client
// You can pass in your own credentials or change the default behavior here
return sasl.NewSCRAMClient(
"username", // replace with your username
"password", // replace with your password
)
}
The above is the sample code which i used for initializing the producer, but i am gettting something like this
kafka: invalid configuration (A SCRAMClientGeneratorFunc function must be provided to Net.SASL.SCRAMClientGeneratorFunc)
2024/11/30 05:57:09 Failed to create Kafka producer: kafka: invalid configuration (A SCRAMClientGeneratorFunc function must be provided to Net.SASL.SCRAMClientGeneratorFunc)
The text was updated successfully, but these errors were encountered:
config := sarama.NewConfig()
config.Producer.Return.Successes = true
config.Net.SASL.Enable = true
config.Net.SASL.User = os.Getenv("KAFKA_USERNAME")
config.Net.SASL.Password = os.Getenv("KAFKA_PASSWORD")
config.Net.SASL.Mechanism = sarama.SASLTypeSCRAMSHA512 // Specify the mechanism
The above is the sample code which i used for initializing the producer, but i am gettting something like this
kafka: invalid configuration (A SCRAMClientGeneratorFunc function must be provided to Net.SASL.SCRAMClientGeneratorFunc)
2024/11/30 05:57:09 Failed to create Kafka producer: kafka: invalid configuration (A SCRAMClientGeneratorFunc function must be provided to Net.SASL.SCRAMClientGeneratorFunc)
The text was updated successfully, but these errors were encountered: