FEAT: Add end_after and auto_offset_reset to kafka task#65
Merged
Conversation
- end_after: wall-clock read deadline that stops the consumer regardless of traffic, mirroring the ServerBase pattern used by the SQS task. - auto_offset_reset: exposes the group-mode reset policy so pipelines can opt into 'latest' (skip historical data) instead of the previously hardcoded 'earliest'. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Copilot started reviewing on behalf of
Divyanshu Tiwari (divyanshu-tiwari)
May 18, 2026 12:35
View session
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Kafka pipeline task’s read-mode behavior by (1) supporting a wall-clock cutoff via end_after and (2) making the consumer-group offset reset policy configurable via auto_offset_reset (defaulting to earliest). It also updates task docs and example pipeline config to reflect the new options.
Changes:
- Embed
task.ServerBasein the Kafka task soend_afteris supported and enforced via a context timeout in the read loop. - Add
auto_offset_resetto Kafka group-consumer configuration (validated toearliest|latest, defaultearliest). - Update Kafka task README and the test pipeline YAML to document and demonstrate the new fields.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
test/pipelines/kafka_read.yaml |
Adds example usage of end_after and auto_offset_reset in a Kafka read pipeline. |
internal/pkg/pipeline/task/kafka/README.md |
Documents end_after and auto_offset_reset, including YAML examples and behavioral notes. |
internal/pkg/pipeline/task/kafka/kafka.go |
Implements end_after read cutoff (via ServerBase.EndAfter) and configures group consumer auto.offset.reset from auto_offset_reset. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Mahesh Kamble (ma-gk)
previously approved these changes
May 19, 2026
Yash Shrivastava (alephys26)
previously approved these changes
May 19, 2026
prasadlohakpure
previously approved these changes
May 19, 2026
41ec4f8
Mayuresh Pawar (Mayureshpawar29)
approved these changes
May 19, 2026
Yash Shrivastava (alephys26)
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request adds two new features to the Kafka pipeline task: a wall-clock read deadline via the
end_afterfield and configurable group consumer offset reset behavior via theauto_offset_resetfield. It also updates documentation and configuration to reflect these enhancements and ensure correct defaulting and validation.Kafka read behavior enhancements:
end_afterfield to the Kafka task, allowing the reader to stop cleanly after a specified wall-clock duration, regardless of message traffic. This is implemented in both the code (kafka.go) and documented with YAML examples and notes. [1] [2] [3] [4] [5] [6]auto_offset_resetfield for group consumers, letting users choose whether to start from the earliest or latest offset when no committed offset is found or the stored offset is out of range. The default isearliest, and this is now configurable and validated. Documentation and examples have been updated accordingly. [1] [2] [3] [4] [5] [6] [7]Documentation and configuration updates:
end_afterandauto_offset_reset, clarifying their behavior and use cases. [1] [2] [3] [4]auto_offset_resettoearliestin code and ensured it is always initialized. [1] [2]Internal refactoring:
task.ServerBaseinstead oftask.Basefor improved code consistency.Test
auto_offset_reset: latestwas able to point the consumer to latest available offset after the messages were deleted from the topic due to Kafka retention policy.end_afterthe pipeline continues to pull keywords from the topic and withend_afterit stopped pulling keywords after the specified time.Types of changes
Checklist