In that case you will have to maintain the offsets consumed and reset the 
offsets in case you need to consume from past.

For example, suppose you have a userA for which you have a partitionA for topic 
TopicA. Each page shown to user increments the offset by 10. You have consumed 
till offset 100 and the user wants to go back 1 page you will have to reset the 
offset for TopicA partitionA in the zookeeper. Since you are using simple 
consumer the offset management has to be done by your application.

Thanks,

Mayuresh

Sent from my iPhone

> On Feb 3, 2015, at 9:18 PM, Snehalata Nagaje 
> <snehalata.nag...@harbingergroup.com> wrote:
> 
> 
> 
> Hi ,
> 
> 
> We are using kafka for storing messages in chat application.
> 
> Currently we divided each topic in multiple partitions. each partition stores 
> data for given customer who uses the application.
> 
> Right now on very first request, application fetches log from kafka from 
> earliest valid offset to maxiumum 100000 bytes. hence it reads all messages 
> for given topic
> 
> for given partition. Now we want to apply pagination as linkedin, facebook 
> does. Only latest 10-15 messages should be displayed. And then on scroll down
> 
> fetch next set of previous messages, we are using Simple consumer to fetch 
> messages.
> 
> Can you please guide on this?
> 
> 
> Thanks,
> Snehalata

Reply via email to