Please create usage of KafkaConsumer and poll() I am not able to get data
See original GitHub issuefrom kafka import KafkaConsumer
# To consume latest messages and auto-commit offsets
consumer = KafkaConsumer('testing_topic',
group_id='my-group',
bootstrap_servers=['192.168.10.5:9092'])
message = consumer.poll(500)
print(message.value)
Please suggest me how to use poll()
like above. Of course above code is not working.
Issue Analytics
- State:
- Created 6 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Chapter 4. Kafka Consumers: Reading Data from Kafka
The parameter we pass, poll() , is a timeout interval and controls how long poll() will block if data is not available in...
Read more >Kafka Consumer Poll runs indefinitely and doesn't return ...
I am getting the below error: org.apache.kafka.common.errors.SerializationException: Error deserializing key/value for partition at offset 2. If ...
Read more >What happens when you call poll on Kafka Consumer?
There is a heartbeat thread that notifies cluster about consumer liveness. It is created within poll method if it does not exist.
Read more >Kafka Tutorial: Creating a Kafka Consumer in Java
The Kafka consumer uses the poll method to get N number of records. Consumers in the same group divide up and share partitions...
Read more >Creating Kafka Consumer in Java - Javatpoint
This can be done via a consumer group. In the consumer group, one or more consumers will be able to read the data...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ooops, missed 1 for cycle:
Thank a lot~ finally I find a solution