Support Questions

Find answers, ask questions, and share your expertise

Ambari, set "auto.offset.reset" property for kafka?

avatar
Contributor

Hi,

I wanted to set "auto.offset.reset" to smallest in kafka consumer, as i my kafka consumer (spark-scala program) is not reading data from beginning currently.

https://kafka.apache.org/08/configuration.html

* smallest : automatically reset the offset to the smallest offset

Thanks & Regards,

Vinti

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Vinti Maheshwari go to kafka configuration page and add the custom property if it's not there or change the value for the property.

View solution in original post

2 REPLIES 2

avatar
Master Mentor

@Vinti Maheshwari go to kafka configuration page and add the custom property if it's not there or change the value for the property.

avatar
Explorer

I realize this is an old answer but it is wrong and I don't want people going down the wrong path. The auto.offset.reset config is on the consumer side, not the topic or broker side. You can add it as a custom property all day long in the Kafka configuration page but that won't help anything. This setting is driven from whatever code is consuming your topic. Also, some of the language has changed: "latest, earliest, or none" work for the new consumer API and "smallest, largest, or {any other value}" work for the old consumer API.