php editor Xinyi is here to introduce to you about SASL loss and Franz-go kafka authentication issues. When using Franz-go kafka for authentication, sometimes you encounter SASL loss, causing authentication failure. This issue can be caused by a variety of reasons, such as configuration errors, network issues, etc. There are many ways to solve this problem, which can be solved by checking the configuration, restarting the service, troubleshooting the network connection, etc. In this article, we will introduce the causes and solutions to this problem in detail, hoping to help everyone.
I am getting these error messages
<code> "re-updating metadata due to err: broker closed the connection immediately after a request was issued, which happens when SASL is required but not provided: is SASL missing?" "read from broker errored, killing connection after 0 successful responses (is SASL missing?)" </code>
I'm trying to add authentication. My code is:
auth := scram.Auth{ User: "kafka_user", Pass: "kafka_pass", } cl, err := kgo.NewClient( kgo.SeedBrokers(seeds...), kgo.DialTLSConfig(tlsConfig), kgo.SASL(auth.AsSha512Mechanism()), kgo.ConsumerGroup(consumerGroupId), kgo.ConsumeTopics(topics...), kgo.WithLogger(kzap.New(logger.GetLogger())), )
The requirements for authentication are:
I tried everything in the documentation. Even with the help of google bard and Bing AI and trying all possible solutions, this problem still persists.
There is no problem with the package. The code is not deployed, so the problem is not with the code but with the deployment.
The above is the detailed content of Is SASL lost? Franz-go kafka authentication issue. For more information, please follow other related articles on the PHP Chinese website!