# Kafka Consumer

> A program that reads events from Kafka in order. An offset marks its place.

**Field:** Data Engineering  
**Category:** Ingestion & Streaming  
**Also known as:** Consumer (Kafka), Kafka Consumer Client

## Think of it like

It is like reading a long book with a bookmark. You stop, and later you go on where you left off.

## Definition

A Kafka consumer is a program that reads events from a Kafka topic. It reads each partition in order, from oldest to newest. It keeps its place with an offset, which it saves as it goes. Reading does not delete anything, so many consumers can read the same events. Consumers that share a group split the partitions between them. That lets them read a busy topic faster.

## Example

Two apps read the orders topic: one loads the warehouse and one sends emails. Each has its own group, so each gets every order.

## Example code

```console
$ bin/kafka-console-consumer.sh --topic orders --from-beginning --bootstrap-server localhost:9092
order 1001 placed
order 1002 placed
```

Read the topic from its first event. Every order is still there after it was read.

## Why it matters

Reading does not delete, so a new app can replay old events. That is how a new report gets its history.

## Common mistake

Thinking an event is gone once it is read. It stays until the topic's retention time runs out.

## Three principles

- **In order.** Per partition, oldest first.
- **Keeps its place.** The offset is its bookmark.
- **Reads, never deletes.** Others can read the same events.

## Related terms

- [Apache Kafka](https://learn.benibix.com/term/data/apache-kafka)
- [Kafka Offset](https://learn.benibix.com/term/data/kafka-offset)
- [Kafka Consumer Group](https://learn.benibix.com/term/data/kafka-consumer-group)
- [Kafka Producer](https://learn.benibix.com/term/data/kafka-producer)
- [Kafka Retention](https://learn.benibix.com/term/data/kafka-retention)

![A producer writes events into a topic with three partitions, each an ordered list of numbered events. Two consumers in one group each read their own partitions, and each keeps its place with an offset.](https://learn.benibix.com/diagrams/kafka-topic-partitions.svg)

---

Source: https://learn.benibix.com/term/data/kafka-consumer
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
