Building Data Streaming Applications with Apache Kafka
by Chanchal Singh, Manisha Sethi, Manish Kumar, Anshul Joshi
Consumer request processing
Same as the producer requests, consumer fetch requests start with metadata requests. Once the consumer is aware of the leader information, it forms a fetch request containing an offset from which it wants to read the data. It also provides the minimum and maximum number of messages it wants to read from the leader broker.
The consumer can pre-allocate memory for the response from the broker, and therefore, we should specify the maximum limit of memory allocation. If the minimum limit is not specified, there could be inefficient utilization of resources when the broker sends a small portion of the data for which very little memory is required. Instead of processing a small amount of data, the consumer can wait for ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access