PHP examples: add a sink data producer

Đang mở Phù hợp với người mới
#4,794 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
88/100
Loại issue
Tính năng
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
json, php
Lĩnh vực
backend, devtools

Hướng nghiên cứu

Đọc examples/python/sink-data-producer/producer.py để xem các trường của bản ghi và kích thước lô, sau đó làm theo examples/php/message-envelope/producer.php và examples/php/src/common.php để biết cách thiết lập PHP và các lệnh gọi gửi dữ liệu. Thêm producer tại examples/php/sink-data-producer/producer.php và ghi tài liệu trong examples/php/README.md sau “Message Envelopes.” Hoàn thành khi chương trình tạo stream và topic nếu chúng chưa tồn tại, gửi 100 lô, ghi nhật ký tổng số và lệnh trong README chạy thành công với máy chủ mới.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

good first issue php
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 PHP examples have none.

Affected area / component

PHP examples

Proposed solution

Add examples/php/sink-data-producer/producer.php and a "Sink Data Producer" section in examples/php/README.md, after "Message Envelopes".

  • Take the record fields and batch sizes from examples/python/sink-data-producer/producer.py, and build the JSON with json_encode.
  • examples/php/src/common.php already does the setup: iggy_client() (which reads IGGY_CONNECTION_STRING, or IGGY_HOST, IGGY_PORT, IGGY_USERNAME and IGGY_PASSWORD), ensure_stream_and_topic() and send_payloads(). examples/php/message-envelope/producer.php shows them in use.
  • Add only IGGY_STREAM (default qw) and IGGY_TOPIC (default records), and say in the README that the connection settings are the PHP ones, not the IGGY_ADDRESS of the other SDKs.
  • The producer creates the stream and topic if they are missing, sends 100 batches of 100 to 499 records, logs the total and exits.
  • Use the same php -d extension="${PHP_IGGY_EXTENSION:-...}" form as the other README commands, so the README script runs it in CI.

New PHP SDK calls are out of scope (#3302 tracks parity).

How to test: build the extension (cargo build in foreign/php), start a fresh server (cargo run --bin iggy-server -- --fresh --with-default-root-credentials), run the README command, and poll a few messages back.

Good first issue
  • I think this could be a good first issue for a new contributor
Ngôn ngữ chính
Rust
Star
5.2k
Fork
516
Merge trung bình
2 ngày 12 giờ
Pull request đã merge (30 ngày)
145

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của apache/iggy

Tất cả issue của apache/iggy

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.