Enhancement: Consumer should be able to know committed position before starting to fetch
The current consumer seems to be lacking the ability retrieve the its position or its list of committed offset before it has started fetching data.
I.E. position() and committed(timeout,cb) seem to work only in the on('data',...) event handler
In the Java consumer, a call to
KafkaConsumer.committed(TopicPartition) can be made in the onPartitionsAssigned callback to subscribe
the trick there is that the Java client goes and fetches the committed offset if it hasn't got any local data.
It would be nice to have this feature in the js client
I think query watermark offset will do this for you, and that was added in a recent commit?
Thanks, but those are the offsets the broker has a for a partition. That's metadata not connected with a consumer.
What we're looking after are the COMMITTED offset for a given consumer group and partition.
that is - what we'd expect the committed call to return.
@edenhill can librdkafka mimic the that Java client functionality for this ?
I wonder if we can call consume(0) to get the current offsets on start. Will have to experiment