You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@kafka.apache.org by Rajiv Kurian <ra...@signalfx.com> on 2016/02/02 07:08:02 UTC

Trying to figure out the protocol.

I am trying to write a Kafka client (specifically a consumer) and am using
the protocol document at
https://cwiki.apache.org/confluence/display/KAFKA/A+Guide+To+The+Kafka+Protocol
.

Had a specific question on the Offset Request API:

OffsetRequest => ReplicaId [TopicName [Partition Time MaxNumberOfOffsets]]
  ReplicaId => int32
  TopicName => string
  Partition => int32
  Time => int64
  MaxNumberOfOffsets => int32

What does the MaxNumberOfOffsets field here mean? I noticed that in the
response:

OffsetResponse => [TopicName [PartitionOffsets]]
  PartitionOffsets => Partition ErrorCode [Offset]
  Partition => int32
  ErrorCode => int16
  Offset => int64

Offset is an array of offsets. I am guessing this is where the
MaxNumberOfOffsets comes from. I am not quite sure how to use this feature.
So far I have been setting MaxNumberOfOffsets = 1.

Thanks,
Rajiv