kafka icon indicating copy to clipboard operation
kafka copied to clipboard

"--from-beginning" consumer equivalent?

Open vbhayden opened this issue 6 years ago • 0 comments

With the kafka-console-consumer, there's a --from-beginning option for getting all messages across a topic's partitions. I've tried setting the startingOffset:

const consumer = new kafka.GroupConsumer({
    connectionString: KAFKA_URLS,
    startingOffset: kafka.EARLIEST_OFFSET
});

as well as the time in the subscribe call:

consumer.subscribe(KAFKA_XAPI_TOPIC, dataHandler, {
    time: kafka.EARLIEST_OFFSET
})
.then(function (result) {
    //
})

but neither of these seemed to do it. Is there a way to mimic that --from-beginning behavior from the console consumer?

vbhayden avatar Dec 19 '18 00:12 vbhayden