A fetch request is a Kafka client request that asks a broker to return records from a topic partition beginning at a specified offset. The consumer sends the request; the broker queues and processes it, retrieves a batch, and returns that batch in its response. Reading records does not remove them, change retention, or affect other consumers. section 2.3 section 2.10
A typical fetch flow is:
- The consumer specifies a topic partition and the offset from which it wants to read. section 2.3
- The broker takes the request from its request queue and fetches a batch of records. section 2.3 section 2.10
- The broker returns the batch to the consumer, which processes the records. section 2.3
Polling sales records
A Java KafkaConsumer subscribes to topics and repeatedly calls poll. A poll can return records retrieved by a new fetch request or records cached from an earlier call; returned sales records can then be logged or otherwise processed. section 4.3
Figure 2.3 Brokers handling requests from a consumer
Trace the broker-side handling of a consumer fetch request from request arrival through record retrieval and response. section 2.3

