Skip to content
This repository has been archived by the owner on Jul 17, 2018. It is now read-only.

Commit

Permalink
Allow to override loop_delay
Browse files Browse the repository at this point in the history
  • Loading branch information
dim committed Feb 5, 2014
1 parent a4cd818 commit 84b7096
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/fluq/input/kafka.rb
Expand Up @@ -67,7 +67,8 @@ def consumer
@consumer ||= ::FluQ::Kafka::Consumer.new config[:group], config[:brokers], config[:zookeepers], config[:topic],
min_bytes: config[:min_bytes],
max_bytes: config[:max_bytes],
max_wait_ms: config[:max_wait_ms]
max_wait_ms: config[:max_wait_ms],
loop_delay: config[:loop_delay]
end

def configure
Expand All @@ -80,6 +81,7 @@ def defaults
min_bytes: 0,
max_bytes: (1024 * 1024),
max_wait_ms: 100,
loop_delay: 0.5,
brokers: ["localhost:9092"],
zookeepers: ["localhost:2181"]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/fluq/input/kafka_spec.rb
Expand Up @@ -22,7 +22,7 @@ def input(opts = {})
it { should be_a(FluQ::Input::Base) }
its(:description) { should == "kafka:my-topic (fluq <- localhost:9092)" }
its(:name) { should == "kafka:my-topic" }
its(:config) { should == {format: "json", format_options: {}, group: "fluq", min_bytes: 0, max_bytes: 1048576, max_wait_ms: 100, brokers: ["localhost:9092"], zookeepers: ["localhost:2181"], topic: "my-topic"} }
its(:config) { should == {format: "json", format_options: {}, group: "fluq", min_bytes: 0, max_bytes: 1048576, max_wait_ms: 100, brokers: ["localhost:9092"], zookeepers: ["localhost:2181"], topic: "my-topic", loop_delay: 0.5} }

it 'should require a topic option' do
-> { input }.should raise_error(ArgumentError, /No topic provided/)
Expand Down

0 comments on commit 84b7096

Please sign in to comment.