You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Thakrar, Jayesh" <jt...@conversantmedia.com> on 2017/10/30 01:55:50 UTC

Offsets in Kafka producer start with -1 for new topic

I created a new Kafka topic with 1 partition and then sent 10 messages using the KafkaProducer API using the async callback.
What I saw was that the offsets in the RecordMetadata for the first record was -1.
Shouldn't it be 0 as offsets start with 0?

Is it a bug or works as expected?

Thanks,
Jayesh


Re: Offsets in Kafka producer start with -1 for new topic

Posted by "Thakrar, Jayesh" <jt...@conversantmedia.com>.
No exceptions or dropped messages.
I injected/sent 100 messages and could read back all 100 of them.
Its just that the offset numbers are not as expected for the producer.


On 10/30/17, 2:28 AM, "Manikumar" <ma...@gmail.com> wrote:

    Any exception in the callback exception field?
    may be you can enable client debug logs to check any errors.
    
    On Mon, Oct 30, 2017 at 7:25 AM, Thakrar, Jayesh <
    jthakrar@conversantmedia.com> wrote:
    
    > I created a new Kafka topic with 1 partition and then sent 10 messages
    > using the KafkaProducer API using the async callback.
    > What I saw was that the offsets in the RecordMetadata for the first record
    > was -1.
    > Shouldn't it be 0 as offsets start with 0?
    >
    > Is it a bug or works as expected?
    >
    > Thanks,
    > Jayesh
    >
    >
    


Re: Offsets in Kafka producer start with -1 for new topic

Posted by Manikumar <ma...@gmail.com>.
Any exception in the callback exception field?
may be you can enable client debug logs to check any errors.

On Mon, Oct 30, 2017 at 7:25 AM, Thakrar, Jayesh <
jthakrar@conversantmedia.com> wrote:

> I created a new Kafka topic with 1 partition and then sent 10 messages
> using the KafkaProducer API using the async callback.
> What I saw was that the offsets in the RecordMetadata for the first record
> was -1.
> Shouldn't it be 0 as offsets start with 0?
>
> Is it a bug or works as expected?
>
> Thanks,
> Jayesh
>
>