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
When I added a password to Kafa's access, the creation of the pusher did not find the parameter to set the password, resulting in the pusher not working. I want to know where to set the password for access
The text was updated successfully, but these errors were encountered:
package main
import (
"github.com/Shopify/sarama"
// Assuming kq is your package which includes NewPusher
"kq"
)
func main() {
// Configuration for Kafka
config := sarama.NewConfig()
config.Net.SASL.Enable = true
config.Net.SASL.User = "your_username"
config.Net.SASL.Password = "your_password"
config.Net.SASL.Mechanism = sarama.SASLTypePlaintext // Use PLAIN mechanism, adjust as necessary
// Broker addresses
brokers := []string{"localhost:9092"}
// Create a new client with the configured settings
client, err := sarama.NewClient(brokers, config)
if err != nil {
panic(err)
}
defer client.Close()
// Assuming NewPusher takes a client or configuration. Adjust according to actual function signature:
pusher, err := kq.NewPusher(client)
if err != nil {
panic(err)
}
// Use your pusher
}
When I added a password to Kafa's access, the creation of the pusher did not find the parameter to set the password, resulting in the pusher not working. I want to know where to set the password for access
The text was updated successfully, but these errors were encountered: