kafka auto.offset.reset
时间: 2023-04-26 21:02:55 浏览: 119
kafka auto.offset.reset是Kafka中的一个配置参数,用于指定当消费者第一次订阅一个主题时,从哪个偏移量开始消费消息。该参数有两个可选值:earliest和latest。如果设置为earliest,则消费者将从最早的可用消息开始消费;如果设置为latest,则消费者将从最新的消息开始消费。
相关问题
kafka auto.offset.reset有哪几个配置项
Kafka中auto.offset.reset有以下三个配置项:
1. earliest:如果在消费者组中没有存储偏移量,或者偏移量超出了可用范围,则从最早的可用消息开始消费。
2. latest:如果在消费者组中没有存储偏移量,或者偏移量超出了可用范围,则从最新的可用消息开始消费。
3. none:如果在消费者组中没有存储偏移量,则抛出异常。
auto.offset.reset
Auto.offset.reset is a configuration parameter in Apache Kafka that determines what happens when a consumer joins a consumer group or when it has no previously committed offsets. The parameter specifies where the consumer should start reading messages from the topic partition it's assigned to.
The three possible values for auto.offset.reset are:
- latest: the consumer will read only new messages that are produced after it joins the group.
- earliest: the consumer will read all messages from the beginning of the topic partition, including messages that were produced before the consumer joined the group.
- none: if there are no committed offsets for the consumer, an error will be raised when it tries to read messages.
The default value for auto.offset.reset is latest. It's important to carefully choose the appropriate value for this parameter, as it can affect the behavior of the consumer and the accuracy of the data it reads.
相关推荐
![](https://img-home.csdnimg.cn/images/20210720083646.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)