So in my java code how can I check when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that data has been deleted)
So in this case as you have said I can set offset as props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); //or latest Thanks Sachin On Mon, Nov 21, 2016 at 4:16 PM, Eno Thereska <eno.there...@gmail.com> wrote: > Hi Sachin, > > Currently you can only change the following global configuration by using > "earliest" or "latest", as shown in the code snippet below. As the Javadoc > mentions: "What to do when there is no initial offset in Kafka or if the > current offset does not exist any more on the server (e.g. because that > data has been deleted)": > > ... > props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest"); > ... > return new KafkaStreams(builder, props) > > > > In addition, there is a tool to reset the offsets of all topics to the > beginning. This is useful for reprocessing: https://www.confluent.io/blog/ > data-reprocessing-with-kafka-streams-resetting-a-streams-application/ < > https://www.confluent.io/blog/data-reprocessing-with- > kafka-streams-resetting-a-streams-application/> > > However, there is no option currently for resetting the offset to an > arbitrary offset. > > Thanks > Eno > > > On 21 Nov 2016, at 10:37, Sachin Mittal <sjmit...@gmail.com> wrote: > > > > Hi > > I am running a streaming application with > > streamsProps.put(StreamsConfig.APPLICATION_ID_CONFIG, "test"); > > > > How do I find out the offsets for each of the source, intermediate and > > internal topics associated with this application. > > > > And how can I reset them to some specific value via shell of otherwise. > > > > Thanks > > Sachin > >