Home > Backend Development > Golang > Is SASL lost? Franz-go kafka authentication issue

Is SASL lost? Franz-go kafka authentication issue

WBOY
Release: 2024-02-08 21:40:18
forward
668 people have browsed it

SASL 丢失了吗? Franz-go kafka 身份验证问题

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.

Question content

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>
Copy after login

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())),
    )
Copy after login

The requirements for authentication are:

  • SSL: false
  • Security protocol: SASL_PLAINTEXT
  • SASL mechanism: SCRAM-SHA-512
  • Username:<>
  • Password:<>

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.

Solution

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!

Related labels:
source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template