You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Neha Narkhede (JIRA)" <ji...@apache.org> on 2014/12/05 18:12:12 UTC

[jira] [Commented] (KAFKA-1808) SimpleConsumer not working as expected

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

Neha Narkhede commented on KAFKA-1808:
--------------------------------------

Please look at the "Finding Starting Offset for Reads" section of the example to know how to retrieve offsets from the previous run of the consumer. You may need to close troubleshoot how your consumer maintains it's offsets and how it retrieves it on restart. You can also look at the Also, these sort of questions are best suited for the mailing list. JIRAs are filed once it is determined that we may be looking at a bug.

> SimpleConsumer not working as expected
> --------------------------------------
>
>                 Key: KAFKA-1808
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1808
>             Project: Kafka
>          Issue Type: Bug
>          Components: consumer
>    Affects Versions: 0.8.1.1
>         Environment: linux_x64
>            Reporter: ajay
>            Assignee: Neha Narkhede
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I followed following link
> https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
> The consumers are consuming messages from a specific partition. But the issue is that when my consumer is running and I push messages to a specif partition of a topic using a producer it consumes messages from that partition. 
> But if my consumer is not running at present and I push some messages to the topic and again start the consumer it do not consume the messages which were pushed by the producer but again it is ready to consume messages which will be pushed now. 
> I am using LatestTime() instead of EarliestTime() as I want to consume only unprocessed messages.
> For example:
> Case -1
> Consumer is running :
> Producer pushed M1, M2, M3 message to partition 1 of topic 1
> result: consumer will consume all three messages.
> Case - 2
> Consumer is not running
> producer now pushes m4, m5 m6 messgae to partition 1 of topic 1
> consumer is invoked now
> result : consumer do not consume messages m4, m5, m6.
> But If I check the offset then it is set to 7. This means the producer has advanced the offset to 7 while producing messages as a result the consumer will consume messages from offset 7 now i.e. the consumer will not consume messages m4,m5,m6.
> Please help ideally when when consumer comes up again it should read messages from m4. SimpleConsumer should have started reading messages from the point where he has left last time once it comes up again.
> I might have filed it in a wrong category as bug, but need help to just consume unprocessed messages only. Please help with 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)