cli: poll messages as a consumer group, from a timestamp, and in follow mode

Đang mở
#4,446 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 2 ngày

@marvelefe đang làm issue này rồi.

Từ ngày 25/10/2026.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Start with core/cli/src/commands/binary_message/poll_messages.rs and the IggyConsumer implementation in core/sdk/src/clients/consumer.rs; compare the existing poll options with PollingStrategy::timestamp in core/common/src/types/message/polling_strategy.rs. Check the HTTP consumer-group limitation in core/sdk/src/http/consumer_groups.rs and account for the noted group/rebalancing behavior. Done means the CLI supports group, timestamp and follow modes with the specified conflicts, cleanup, transport rejection and auto-commit help text.

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

Mô tả

enhancement tui

Problem

iggy message poll reads one batch from one partition as a regular consumer.

  • It always polls as a regular consumer (core/cli/src/commands/binary_message/poll_messages.rs:64). You cannot read a topic the way a group member reads it.
  • It can start from --offset, --first, --last or --next (:55), but not from a timestamp. The SDK has PollingStrategy::timestamp (core/common/src/types/message/polling_strategy.rs:72).
  • It reads one batch and exits. To watch a live partition, you must run it in a shell loop, for example with --next --auto-commit. Each run connects and logs in again.

Proposal

  • Add -g, --consumer-group <GROUP>. The CLI joins the group and polls the partitions that the server assigns to it. On exit, it leaves the group, also after Ctrl-C or an error. -g conflicts with -c, --offset and <PARTITION_ID>.
  • Add --timestamp <TIME>. Accept an RFC 3339 time, Unix microseconds, or a duration back from now (15min).
  • Add --follow. Keep polling until Ctrl-C, and wait for --poll-interval (default 100ms) after an empty batch.
  • Build the group and follow modes on IggyConsumer (core/sdk/src/clients/consumer.rs). It already joins the group, tracks the offset of each partition, commits, and leaves the group on shutdown. Turn off its automatic group creation.

Notes

  • A member that disconnects without a leave keeps its partitions until consumer_group.session_timeout (default 30 s) expires.
  • A join moves partitions from other members. A partition with uncommitted polled messages moves only after its owner commits them, or after consumer_group.rebalancing_timeout (default 30 s). So a single -g poll on a busy group often gets no partition. #4391 can also leave a new member without a partition.
  • With --auto-commit, the group offset moves past the messages that the CLI prints, so the other members never get them. The help text must say this.
  • Over HTTP, -g cannot work, because a group join returns FeatureUnavailable (core/sdk/src/http/consumer_groups.rs:116). Reject -g with --transport http before the CLI connects.
  • The server has no long poll yet. When #3470 (deferred polling timeout) lands, use it in follow mode.
Ngôn ngữ chính
Rust
Star
5.3k
Fork
548
Merge trung bình
2 ngày 20 giờ
Pull request đã merge (30 ngày)
194

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.