What is poll in Kafka?
Eleanor Gray
Updated on May 04, 2026
.
Hereof, what is poll in Kafka consumer?
A consumer requests messages from Kafka by calling Consumer. poll() regularly. The consumer calls poll() , receives a batch of messages, processes them promptly, and then calls poll() again. When a consumer processes a message, the message is not removed from its topic.
Additionally, is Kafka consumer thread safe? The Kafka consumer is NOT thread-safe. All network I/O happens in the thread of the application making the call. It is the responsibility of the user to ensure that multi-threaded access is properly synchronized. Un-synchronized access will result in ConcurrentModificationException .
Keeping this in view, is Kafka pull or push?
With Kafka consumers pull data from brokers. Other systems brokers push data or stream data to consumers. Messaging is usually a pull-based system (SQS, most MOM use pull). A pull-based system has to pull data and then process it, and there is always a pause between the pull and getting the data.
What is Max Poll records in Kafka?
Kafka consumer has a configuration max. poll. records which controls the maximum number of records returned in a single call to poll() and its default value is 500.
Related Question AnswersHow do you scale Kafka consumers?
There are 2 things you can scale up: Kafka, or the consumers. If your producers produce more messages on one topic, you might want to multiply the number of consumers so they can cover more work at the same time, you're going to scale horizontally.How does Kafka work?
Distributed. A distributed system is one which is split into multiple running machines, all of which work together in a cluster to appear as one single node to the end user. Kafka is distributed in the sense that it stores, receives and sends messages on different nodes (called brokers).Does Kafka write to disk?
1 Answer. Kafka always writes directly to disk, but remember one thing the I/O operations are really carried out by the Operating System. In case of Linux it seems the data is written to the page cache until it can be written to the disk.How does Kafka offset work?
The offset is a simple integer number that is used by Kafka to maintain the current position of a consumer. That's it. The current offset is a pointer to the last record that Kafka has already sent to a consumer in the most recent poll. So, the consumer doesn't get the same record twice because of the current offset.How do I get data from Kafka?
Quickstart- Step 1: Download the code. Download the 2.4.
- Step 2: Start the server.
- Step 3: Create a topic.
- Step 4: Send some messages.
- Step 5: Start a consumer.
- Step 6: Setting up a multi-broker cluster.
- Step 7: Use Kafka Connect to import/export data.
- Step 8: Use Kafka Streams to process data.