Skip to content

Fix/pusher sasl tls#102

Draft
ljluestc wants to merge 1 commit intozeromicro:masterfrom
ljluestc:fix/pusher-sasl-tls
Draft

Fix/pusher sasl tls#102
ljluestc wants to merge 1 commit intozeromicro:masterfrom
ljluestc:fix/pusher-sasl-tls

Conversation

@ljluestc
Copy link

:

  • 修改 kq/pusher.go:
    • pushOptions 结构体中添加 username, password, tlsConfig, saslMechanism 字段。
    • 新增 WithSaslPlain(username, password string) 选项函数,用于设置认证信息。
    • 新增 WithTLS(tlsConfig *tls.Config)WithSASL(saslMechanism sasl.Mechanism) 选项函数。
    • NewPusher 函数中,检查是否配置了 TLS 或 SASL。如果配置了,则为 kafka.Writer 初始化 Transport 并配置相应的 TLSSASL 机制。

关联 Issue:
Fixes #83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

写不进去kafka但是可以创建topic

1 participant