[ 
https://issues.apache.org/jira/browse/KAFKA-9322?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17002073#comment-17002073
 ] 

ASF GitHub Bot commented on KAFKA-9322:
---------------------------------------

huxihx commented on pull request #7860: KAFKA-9322: Add `tail -n` feature for 
ConsoleConsumer
URL: https://github.com/apache/kafka/pull/7860
 
 
   https://issues.apache.org/jira/browse/KAFKA-9322
   
   When debugging, it will be convenient to quickly check the last N messages 
for a partition using ConsoleConsumer. Currently `offset` could not be negative 
except -1 and -2. However, we could simply break this rule to support `tail -n` 
feature.
   
   Slightly different, with this patch applied, -1 means the last one message 
instead of the latest offset, -2 means the last two messages intead of the 
earliest offset. You could use `latest` and `earliest` explicitly if you really 
start reading from those positions.
   
   *More detailed description of your change,
   if necessary. The PR title and PR message become
   the squashed commit message, so use a separate
   comment to ping reviewers.*
   
   *Summary of testing strategy (including rationale)
   for the feature or bug fix. Unit and/or integration
   tests are expected for any behaviour change and
   system tests should be considered for larger changes.*
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add `tail -n` feature for ConsoleConsumer
> -----------------------------------------
>
>                 Key: KAFKA-9322
>                 URL: https://issues.apache.org/jira/browse/KAFKA-9322
>             Project: Kafka
>          Issue Type: Improvement
>          Components: tools
>    Affects Versions: 2.4.0
>            Reporter: huxihx
>            Assignee: huxihx
>            Priority: Major
>
> When debugging, it will be convenient to quickly check the last N messages 
> for a partition using ConsoleConsumer. Currently `offset` could not be 
> negative except -1 and -2. However, we could simply break this rule to 
> support `tail -n` feature. A tricky thing is currently we treat -1 and -2 as 
> special values, so I am not sure if a new KIP is needed.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to