Go examples: add a sink data producer

未关闭 适合新手
#4,792 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
86/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
backend

调研方向

阅读 examples/python/sink-data-producer/producer.py 及其 README 部分,然后检查 examples/go/common/client.go 和 examples/go/getting-started/producer/main.go,了解连接和设置模式。添加 examples/go/sink-data-producer/main.go 和 README 部分,其中包含指定的环境变量和记录字段。完成标准是:README 中的 go run 命令能在全新的服务器上运行,创建缺少的资源,发送所要求的批次,并且 go vet ./... 通过。

由索引模型根据 Issue 内容生成。

描述

go good first issue
Description

The Rust, Java, Node and Python examples include a sink data producer, which fills a topic with JSON records so a sink connector has something to read. The Go examples have none.

Affected area / component

Go examples

Proposed solution

Add examples/go/sink-data-producer/main.go and a "Sink Data Producer" section in examples/go/README.md.

  • Use examples/python/sink-data-producer/producer.py and its README section as the model. Match the Rust and Python record fields (user_id, user_type, email, source, state, created_at, message) so one connector config works for every SDK. The Node version uses a different set, so do not copy from it.
  • Use the same environment variables as the Python README: IGGY_STREAM (default qw), IGGY_TOPIC (default records), IGGY_ADDRESS, IGGY_USERNAME and IGGY_PASSWORD.
  • examples/go/common/client.go and examples/go/getting-started/producer/main.go show connecting, logging in and creating the stream and topic.
  • The producer creates the stream and topic if they are missing, sends 100 batches of 100 to 499 records, logs the total and exits. Running it again against the same server works, and the stream and topic are kept.
  • Put the command in a go run line in the README, so scripts/run-examples-from-readme.sh runs it in CI.

TLS is out of scope.

How to test: start a fresh server (cargo run --bin iggy-server -- --fresh --with-default-root-credentials), run the producer from examples/go with the README command, poll a few messages back to check they are valid JSON, and run go vet ./... in examples/go.

Good first issue
  • I think this could be a good first issue for a new contributor
主要语言
Rust
星标
5.2k
派生
516
平均合并
2 天 12 小时
30 天内合并 PR
145

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

apache/iggy 的其他 Issue

查看 apache/iggy 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。