Dolphin
Dolphin

Reputation: 39053

kafka fetch data from current time

When I am polling data from Kafka using consumer High Level API, it may contain many history data.

How to setting consume data from now and throw(or give up) the history data. Is there any way to solve this problem?

Kafka version: 0.9.0.1.

Upvotes: 0

Views: 146

Answers (1)

amethystic
amethystic

Reputation: 7091

Using high level API means an automatic offset management is offered for you, and you do not have to manually manage the offset. So check option 'auto.offset.reset' and set it to 'largest'

Upvotes: 3

Related Questions