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

Commit

Permalink
Added consumer abstraction
Browse files Browse the repository at this point in the history
  • Loading branch information
dim committed Feb 5, 2014
1 parent 0836e2a commit a4cd818
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 12 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ source "https://rubygems.org"

gemspec
gem "poseidon", git: "https://github.com/dim/poseidon.git"
gem "poseidon_cluster", git: "https://github.com/bsm/poseidon_cluster.git"
20 changes: 13 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
GIT
remote: https://github.com/bsm/poseidon_cluster.git
revision: 540110f33f3176ba980444509844d075fa11434a
specs:
poseidon_cluster (0.1.0)
poseidon
zk

GIT
remote: https://github.com/dim/poseidon.git
revision: f853e8f07a6f2ff4a520d3f7e1dac030453a18ed
Expand Down Expand Up @@ -26,7 +34,7 @@ GEM
term-ansicolor
thor
diff-lcs (1.2.5)
docile (1.1.2)
docile (1.1.3)
fluq (0.8.0)
celluloid-io (~> 0.15.0)
multi_json
Expand All @@ -38,9 +46,6 @@ GEM
multi_json (1.8.4)
nio4r (1.0.0)
nio4r (1.0.0-java)
poseidon_cluster (0.0.5)
poseidon
zk
rake (10.1.1)
rest-client (1.6.7)
mime-types (>= 1.16)
Expand All @@ -49,9 +54,9 @@ GEM
rspec-expectations (~> 2.14.0)
rspec-mocks (~> 2.14.0)
rspec-core (2.14.7)
rspec-expectations (2.14.4)
rspec-expectations (2.14.5)
diff-lcs (>= 1.1.3, < 2.0)
rspec-mocks (2.14.4)
rspec-mocks (2.14.5)
simplecov (0.8.2)
docile (~> 1.1.0)
multi_json
Expand All @@ -64,7 +69,7 @@ GEM
thor (0.18.1)
timed_lru (0.3.1)
timers (1.1.0)
tins (0.13.1)
tins (0.13.2)
yard (0.8.7.3)
zk (1.9.3)
logging (~> 1.7.2)
Expand All @@ -83,6 +88,7 @@ DEPENDENCIES
coveralls
fluq-kafka!
poseidon!
poseidon_cluster!
rake
rspec
yard
2 changes: 1 addition & 1 deletion lib/fluq/input/kafka.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def process(partition, messages)
protected

def consumer
@consumer ||= ::Poseidon::ConsumerGroup.new config[:group], config[:brokers], config[:zookeepers], config[:topic],
@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]
Expand Down
5 changes: 1 addition & 4 deletions lib/fluq/kafka.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
require 'fluq'
require 'fluq/kafka/version'
require 'poseidon_cluster'
require 'fluq/kafka/consumer'
require 'fluq/input/kafka'

class Poseidon::Connection
TCPSocket = Celluloid::IO::TCPSocket
end
13 changes: 13 additions & 0 deletions lib/fluq/kafka/consumer.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
require 'poseidon_cluster'

class Poseidon::Connection
TCPSocket = Celluloid::IO::TCPSocket
end

module FluQ
module Kafka
class Consumer < Poseidon::ConsumerGroup
end
end
end

0 comments on commit a4cd818

Please sign in to comment.