That config setting will only work if there are no offsets stored in the consumer offsets target.
Something I’ve done in the past is to make the application.id config setting have a random string component to it. So have “my-app-name-[randomchars]” or some such. This ensures that there are never pre-existing offsets. Would that be an acceptable method for you? Matt > On Jan 19, 2018, at 12:22 PM, Saloni Vithalani <salo...@thoughtworks.com> > wrote: > > Our requirement is such that if a kafka-stream app is consuming a > partition, it should start it's consumption from latest offset of that > partition. > > This seems like do-able using > > streamsConfiguration.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "latest") > > Now, let's say using above configuration, the kafka-stream app started > consuming data from latest offset for a partition. And after some time, the > app crashes. When the app comes back live, we want it to consume data from > the latest offset of that partition, instead of the where it left last > reading. > > But I can't find anything that can help achieve it using kafka-streams api. > > P.S. We are using kafka-1.0.0. > > Saloni Vithalani > Developer > Email salo...@thoughtworks.com > Telephone +91 8552889571 <8552889571> > [image: ThoughtWorks] > <http://www.thoughtworks.com/?utm_campaign=saloni-vithalani-signature&utm_medium=email&utm_source=thoughtworks-email-signature-generator>