Not exactly.. forceFromStart=true will tell the spout to start reading from whatever is set in startOffsetTime (available options are the earliest offset or the latest offset). If forceFromStart=false then startOffsetTime is not used at all and the offset is just retrieved from zookeeper, if it's available.
The "Start" in "forceFromStart" has nothing to do with consuming from the beginning of the topic. I interpret it as referring to whether you are going to force starting consumption from a different offset. I really suggest looking at the code too. Here's an example of how these values are used: https://github.com/apache/storm/blob/0eb5f30e95f29a02d88935850527ddb3bd23237b/external/storm-kafka/src/jvm/storm/kafka/PartitionManager.java#L94 On Tue, Mar 31, 2015 at 9:34 AM Sarang Deshpande <[email protected]> wrote: > Thanks everyone for the response. To summarize, config.forceFromStart > lets kafka spout start consuming from the topic's beginning (the earliest > offset available for consumption) and config.startOffsetTime =earliestTime() > is the offset where spout left off consuming last time. > > On Mon, Mar 30, 2015 at 3:03 PM, P. Taylor Goetz <[email protected]> > wrote: > >> The naming of config.forceFromStart is a little confusing, but in a >> nutshell if true, it enables the config.startOffsetTime setting. >> >> If false, the spout will look for an offset in ZK (if any) and start from >> there. If there's no offset in ZK, it will start from the end. >> >> -Taylor >> >> >> On Mar 30, 2015, at 5:35 PM, Sarang Deshpande <[email protected]> >> wrote: >> >> Hello storm users, >> There are two variables in the Kafka spout config, startOffsetTime and >> forceFromStart. If I set these as follows - >> >> config.forceFromStart = *false*; >> config.startOffsetTime = OffsetRequest.EarliestTime(); >> >> Kafka spout reads only the newly published messages (from latest offset) >> and DOES NOT read from start as one would expect. Only when config is set >> as follows, Kafka spout reads from the beginning. >> >> config.forceFromStart = *true*; >> config.startOffsetTime = OffsetRequest.EarliestTime(); >> >> Can someone explain what is the logical difference between forceFromStart >> and startOffsetTime being EarliestTime? >> >> Thanks much >> ~Sarang >> >> PS: Note that on the other hand, if forceFromStart is true and >> startOffsetTime is LatestTime(), that is if they contradict with each >> other, then spout reads only newly published messages. >> >> >
