Try kafkaConfig.forceStartOffsetTime(-1)
. -1
for the latest Kafka offset, and -2
for the earliest available offset.
EDIT:
Also, you can force the spout to start consuming from any desired offset with the same option -- just pass the numeric offset as the only argument.
Ignore the "Time
" in forceStartOffsetTime
, the parameter name is a bit confusing. Offsets in Kafka are numbers and have no connection to any concept of time whatsoever. -1
is just a special way of telling the Kafka spout to gather the latest offset from Kafka itself (idem -2
for the earliest available offset).