kafka-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alexander Gallego <gallego.al...@gmail.com>
Subject Re: Kafka SimpleConsumer.getOffsetsBefore Problem. Kafka 0.7
Date Wed, 26 Sep 2012 14:22:52 GMT
Hello,

I don't mean to spam the mailing list. I emailed yesterday, but I had
made the repo containing the examples 'private' by accident. It is now
open.

Thanks again for reading.


Sincerely,
Alex

---*---
------*
*  *  *




On Tue, Sep 25, 2012 at 9:11 PM, Alexander Gallego
<gallego.alexx@gmail.com> wrote:
> Hello,
>
> I'm having problems with Kafka 0.7:
>
> Here is a project I've put together to show the problem:
> https://bitbucket.org/agallego/kafkaoffset (make sure to run twice:
> once to generate data, and one to see the problem. )
>
> I can't seem to get valid offsets from the queue using a
> SimpleConsumer class.
> (https://bitbucket.org/agallego/kafkaoffset/src/a9043505919dd8743e368e27467dd96ac0c9c0aa/src/main/java/test/kafka/SampleConsumer.java#cl-13)
>
> I can read and write to the queue no problem given an offset.
> Everything works just fine. However, I want to read from the queue the
> last offset from 'now()' . That is to say, I want to pass in an
> arbitrary time in the past and I want to get a list of correct
> offsets. (off course given that there is data before that time)
>
>
> ** What am I seeing instead ? ***
>
> I always get an array of 0's
>
> quite literally long[] tmp = {0L, 0L, 0L....}
>
>
>
> ** What do I expect to see ***
>
> An array of valid offsets as stated by the api.
>
>
>
>
> Is this a bug ? What am I doing wrong. The whole code is about 20
> lines of code. It assumes a running instance of kafka on localhost.
> (off course you can change it)
>
>
> Thanks in advance
>
>
> Sincerely,
> Alex
>
> ---*---
> ------*
> *  *  *

Mime
View raw message