Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `monotonic_time' for Concurrent:Module (NoMethodError) #842

Closed
TJC opened this issue Jun 18, 2020 · 2 comments · Fixed by #845
Closed

undefined method `monotonic_time' for Concurrent:Module (NoMethodError) #842

TJC opened this issue Jun 18, 2020 · 2 comments · Fixed by #845

Comments

@TJC
Copy link

TJC commented Jun 18, 2020

  • Version of Ruby: 2.7.1
  • Version of Kafka: (not applicable)
  • Version of ruby-kafka: 1.1.0
Steps to reproduce
require "kafka"
require "kafka/datadog"

kafka = Kafka.new(brokers, client_id: "example")
consumer = kafka.consumer(group_id: "example_group")
consumer.subscribe("my_topic")
consumer.each_message do |msg|
  puts "hi!"
end

Attempt to run above code, and receive error:

undefined method `monotonic_time' for Concurrent:Module

Fix

Include this extra require prior to the kafka/datadog import:

require "concurrent/utility/monotonic_time"
require "kafka/datadog"
d1egoaz added a commit to d1egoaz/ruby-kafka that referenced this issue Jun 24, 2020
From the comment: `It seems it doesn't need to be threadsafe.`
Via zendesk#835 (comment)

I took a quick look and it seems it's safe to use a simple Hash

Fixes: zendesk#842
Fixes: zendesk#840
@TJC
Copy link
Author

TJC commented Jul 16, 2020

Hi,
I know this issue was closed 20 days ago, but the issue is still present in the current stable release - 1.1.0.

Are there any plans to release a new version that contains the fix?

@TJC TJC reopened this Jul 16, 2020
@dasch
Copy link
Contributor

dasch commented Aug 3, 2020

v1.2.0 has just been released.

@dasch dasch closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants