iit2009060 commented on PR #15060:
URL: https://github.com/apache/kafka/pull/15060#issuecomment-1882517442

   > auto-offset-reset
   
   
   
   > @iit2009060 The behaviour that you mentioned in the 
[comment](https://github.com/apache/kafka/pull/15060#issuecomment-1879657273) 
seems to be working as expected. The client seems to be receiving 
OffsetOutOfRangeException. When a consumer client sends a request for fetch 
offset that is out of range then it receives offset out of range error and it 
sends the next request based on `auto-offset-reset` strategy that is set on the 
consumer client. It seems the default value for `kafka-console-consumer` is 
`latest` if not set through an `auto.offset.reset` property or does not use 
`--from-beginning` argument. In your case, it may be trying to fetch the latest 
offset in the next request and there are no messages published to the topic 
beyond that offset as there may not be any more messages published after that 
offset. You can try running the same scenario of fetching out of range offset 1 
with `--from-beginning` and observe the behavior.
   > 
   > We can syncup offline to understand your scenario better.
   
   @satishd  Check the **5th step** mentioned in the 
[comment](https://github.com/apache/kafka/pull/15060#issuecomment-1879657273)  
where I produced some data. In the **7th step** I made an offset request with 1 
and 6 both ,6th worked fine  but the request with offset 1 goes through the step
   1. handle OutOfOffSetRangeError
   2. It goes through the if condition mentioned in the **step 8** 
   3. Then it goes through the else part 
   `} else {
         createLogReadResult(exception)
       }`
   4. As mentioned in **step 9**    screenshot It creates empty record response 
with exception wrapped in the LogReadResult.
   
   Default configuration is **latest** in the  console consumer. Even for the 
**latest** configuration it should work?
   I will try with from-beginning option and  update the behaviour. 
   


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to