kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sjöberg <kevin.sjob...@fortnox.se>
Subject Re: Using SimpleConsumer to get messages from offset until now
Date Wed, 03 Jun 2015 08:19:58 GMT
Thank you! I will definitely look into that example.

2015-06-03 4:27 GMT+02:00 luo.fucong <bayinamine@gmail.com>:

> I think the SimpleConsumer Example(
> https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example
> <
> https://cwiki.apache.org/confluence/display/KAFKA/0.8.0+SimpleConsumer+Example>)
> in the wiki is a very good starting point.
>
> You can pass in the offset to the FetchRequest. And you can ask for the
> latest offset using kafka.api.OffsetRequest.LatestTime()
>
> > 在 2015年6月3日,上午12:25,Kevin Sjöberg <kevin.sjoberg@fortnox.se>
写道:
> >
> > Hello,
> >
> > I'm trying to create a custom consumer that given a offset returns all
> > messages until now. After this is done, the consumer is not needed
> anymore,
> > hence, the consumer does not have to continue consuming messages that are
> > being produced.
> >
> > The Kafka cluster exists of one broker and we only use one partition as
> > well. My understanding is that I can use the SimpleConsumer API for this,
> > but I'm a bit unsure on how to go about it.
> >
> > Would anyone mind helping me out or point me in the right direction?
> >
> > Cheers,
> > Kevin
> >
> > --
> > Kevin Sjöberg
> >
> > --
> > Du skapar din faktura, vi skickar den och ser till att kunden betalar. Vi
> > sköter allt, hela vägen tills fakturan är betald!
> > Läs om Nox Finans här
> > <
> https://www.fortnox.se/nox/?utm_source=signature&utm_medium=email&utm_campaign=noxfinans&utm_term=fakturahantering
> >
> > .
>
>


-- 
Kevin Sjöberg

-- 
Du skapar din faktura, vi skickar den och ser till att kunden betalar. Vi 
sköter allt, hela vägen tills fakturan är betald! 
Läs om Nox Finans här 
<https://www.fortnox.se/nox/?utm_source=signature&utm_medium=email&utm_campaign=noxfinans&utm_term=fakturahantering>
.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message