ruby-kafka
ruby-kafka copied to clipboard
Why "consumer.each_message..." not looping indefinitely
Maybe I'm doing something wrong; or maybe there is an issue?
- Version of Ruby:
$ ruby -v ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] - Version of Kafka:
$ bin/kafka-configs.sh --version 2.4.1 (Commit:c57222ae8cd7866b) - Version of ruby-kafka:
$ gem list | grep kafka ruby-kafka (1.5.0)
Please verify that the problem you're seeing hasn't been fixed by the current master of ruby-kafka.
- I noticed that the latest release is
1.4.0. Is there a regression in the master branch (which is showing v 1.5.0) that caused this issue?
Steps to reproduce
Using the example at https://github.com/zendesk/ruby-kafka#consumer-groups, I see consumer.each_message(..) grab existing messages from the topic, then it just hangs.
I had the same kinda of issue when getting messages via kafka.each_message(...)
Expected outcome
The consumer should continuously receive messages.
Actual outcome
The consumer receives existing messages then stops receiving new messages.
See also
- repo: https://github.com/drhuffman12/kafka-course
- files:
Ruby/lab4/solutions/lib/kafka_example.rb- https://github.com/drhuffman12/kafka-course/blob/main/Ruby/lab3/solutions/lib/kafka_example/kafka_api.rb#L19
- https://github.com/drhuffman12/kafka-course/blob/5887798c72181774e9b64bd6b452e13f0862e8bd/Ruby/lab4/solutions/lib/kafka_example/lab4_example_storms.rb#L70