Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kafka consumer group offset retention

How long does kafka store the offset of a consumer-group after all consumers in that group fail? Is there a configuration variable for this?

like image 981
masih Avatar asked May 02 '16 07:05

masih


People also ask

How Kafka consumer maintains offset?

As each message is received by Kafka, it allocates a message ID to the message. Kafka then maintains the message ID offset on a by consumer and by partition basis to track consumption. Kafka brokers keep track of both what is sent to the consumer and what is acknowledged by the consumer by using two offset values.

What offset retention minutes?

offsets. retention. minutes allows you to move the offset back to the beginning if it isn't changed within a set period of time.

What is group offset in Kafka?

Consumer offset is recorded in Kafka so if the consumer processing the partition in the consumer group goes down and when the consumer comes back, the consumer will read the offset to start reading the messages from the topic from where it is left off. This avoids duplication in message consumption.

Where does Kafka store offsets for consumers?

Kafka maintains a numerical offset for each record in a partition. This offset acts as a unique identifier of a record within that partition, and also denotes the position of the consumer in the partition.


2 Answers

The right property name is:

offsets.retention.minutes

from https://kafka.apache.org/documentation/#brokerconfigs

like image 114
Jacopo Silvestro Avatar answered Jun 28 '23 11:06

Jacopo Silvestro


The value can be configured in kafka broker using:

offsets.retention.minutes

The default is 24 hours.

See: the Kafka broker config docs.

like image 35
masih Avatar answered Jun 28 '23 09:06

masih