Exactly.
On 12/28/16 10:47 AM, Sachin Mittal wrote:
> Understood. So if we want it to start consuming from earliest we should add
> props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
>
> So when we start the app first time it will start from earliest. Later when
> we stop this app a
Understood. So if we want it to start consuming from earliest we should add
props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
So when we start the app first time it will start from earliest. Later when
we stop this app and restart it will start from point where we has last
committed
Hi Sachin,
What do you mean by "with this commented"? Did you set auto.offset.reset
to "earliest" or not? Default value is "latest" and if you do not set it
to "earliest", that the application will start consuming from
end-of-topic if no committed offsets are found.
For default values of Kafka St
Hi,
I started my new streams app with this commented
//props.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
What I observed was that it started consuming message from latest offset
from the source topic.
Based on comments by Eno I thought that if offset do not exist then
So in practice
One more thing to add:
You could build an own tool to set specific offsets for each partition.
The mentioned reset tool does something similar, setting the offset for
all partitions to zero. But you could just copy the code and enhance it
to set arbitrary offsets for each partition.
However, for
Hi Sachin,
There is no need to check within the app whether the offset exists or not,
since the consumer code will do that check automatically for you. So in
practice an app will include the property below (e.g., set to "earliest"), but
that will only have an effect if the consumer detects that
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");
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. bec