[ 
https://issues.apache.org/jira/browse/KAFKA-10862?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17250720#comment-17250720
 ] 

A. Sophie Blee-Goldman commented on KAFKA-10862:
------------------------------------------------

Hey [~rebekkaxi], you're looking at the default for two different things. The 
docs you linked to are referring to the consumer client configs, which do 
default to "latest". You can find the config definition in 
[ConsumerConfig.|https://github.com/apache/kafka/blob/72918a98161ba71ff4fa8116fdf8ed02b09a0580/clients/src/main/java/org/apache/kafka/clients/consumer/ConsumerConfig.java#L434]

The code you're looking at corresponds to the configs for Kafka Streams. 
Internally Streams embeds a consumer client, and overrides the default 
auto.offset.reset policy to "earliest". You can find the docs for 
Streams-specific configs and how they override the client defaults 
[here|https://kafka.apache.org/25/documentation/streams/developer-guide/config-streams.html#default-values].

So the default for Kafka Streams is indeed different than the default reset 
policy for a plain consumer app. The reason being that Streams generally wants 
to start from the beginning in order to process all available data. Why the 
default for the plain consumer is "latest" is another question :) 

> kafak stream consume from the earliest by default
> -------------------------------------------------
>
>                 Key: KAFKA-10862
>                 URL: https://issues.apache.org/jira/browse/KAFKA-10862
>             Project: Kafka
>          Issue Type: Bug
>          Components: config, consumer
>    Affects Versions: 2.3.1
>         Environment: MAC
>            Reporter: Yuexi Liu
>            Priority: Major
>
> on [https://kafka.apache.org/documentation/#auto.offset.reset] it shows 
> auto.offset.reset is by default using latest, but from code, it is not
>  
> [https://github.com/apache/kafka/blob/72918a98161ba71ff4fa8116fdf8ed02b09a0580/streams/src/main/java/org/apache/kafka/streams/StreamsConfig.java#L884]
>  and when I create a kafka stream without specified offset reset policy, it 
> consumed from the beginning



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to