package main
import (
"fmt"
"github.com/confluentinc/confluent-kafka-go/kafka"
)
// 发送信息到队列
func Send(content, topic string) {
// 构造生产配置
configMap := &kafka.ConfigMap{
...
使用库:github.com/aws/aws-msk-iam-sasl-signer-python
安装方式参考:github.com/aws/aws-msk-iam-sasl-signer-python/blob/main/docs/installation.rst
最终代码:
#!/usr/bin/python3
from kafka import KafkaProducer...
配置相关依赖包:
[codesyntax lang="bash"]
mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/net.git
git clone https://github.com/golang/crypto.git
go get github....