1) ConsumerId is for tracking which client makes the request. It's mostly for debugging right now.
2) The latter is more general. You can ask for an offset before an arbitrary timestamp. Thanks, Jun On Sun, Feb 22, 2015 at 6:35 PM, Stuart Reynolds <s...@stureynolds.com> wrote: > In > > > > http://apache.osuosl.org/kafka/0.8.2-beta/scala-doc/index.html#kafka.consumer.SimpleConsumer > > class SimpleConsumer: > def earliestOrLatestOffset(topicAndPartition: TopicAndPartition, > earliestOrLatest: Long, consumerId:Int): Long > > 1) What's the consumerId? It doesn't seem to matter what value I put > here, nor do I understand why its needed (since the isn't the query > used to lookup the head and tail offsets -- aren't these properties > consumer-independent?) > > > Also > > 2) What's the difference between: > > class SimpleConsumer: > def earliestOrLatestOffset(topicAndPartition: TopicAndPartition, > earliestOrLatest: Long, consumerId:Int): Long > def getOffsetsBefore(request: OffsetRequest): OffsetResponse > > both of these method seem to return the head or tail offsets. > > Thanks > - Stu >