rabbithutch 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Gemfile.lock +4 -4
- data/bin/rabbithutch +0 -0
- data/lib/consumers/mongo_consumer.rb +5 -4
- data/lib/logger.rb +16 -0
- data/lib/rabbithutch.rb +2 -0
- data/rabbithutch.gemspec +1 -1
- metadata +3 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rabbithutch (0.0.
|
4
|
+
rabbithutch (0.0.8)
|
5
5
|
amqp
|
6
6
|
bson_ext
|
7
7
|
daemons
|
@@ -20,10 +20,10 @@ GEM
|
|
20
20
|
activesupport (3.2.9)
|
21
21
|
i18n (~> 0.6)
|
22
22
|
multi_json (~> 1.0)
|
23
|
-
amq-client (0.9.
|
23
|
+
amq-client (0.9.10)
|
24
24
|
amq-protocol (>= 0.9.4)
|
25
25
|
eventmachine
|
26
|
-
amq-protocol (1.0.
|
26
|
+
amq-protocol (1.0.1)
|
27
27
|
amqp (0.9.8)
|
28
28
|
amq-client (~> 0.9.5)
|
29
29
|
amq-protocol (>= 0.9.4)
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
bson (~> 1.8.0)
|
42
42
|
mongo_ext (0.19.3)
|
43
43
|
mq (0.1.3)
|
44
|
-
multi_json (1.
|
44
|
+
multi_json (1.5.0)
|
45
45
|
thor (0.16.0)
|
46
46
|
yard (0.8.3)
|
47
47
|
|
data/bin/rabbithutch
CHANGED
File without changes
|
@@ -9,14 +9,15 @@ module RabbitHutch
|
|
9
9
|
puts "\tInitializing MongoDb Consumer"
|
10
10
|
@config = config
|
11
11
|
@rabbitmq_host = rabbitmq_host
|
12
|
-
|
12
|
+
|
13
13
|
@config.consumers.each do |consumer|
|
14
14
|
if consumer["name"] == 'mongo_consumer'
|
15
|
+
@host = consumer['hostname']
|
16
|
+
@port = consumer["port"]
|
15
17
|
@database_prefix = consumer['database_prefix']
|
16
|
-
|
18
|
+
@database = "#{@database_prefix}#{rabbitmq_host["displayname"]}"
|
19
|
+
end
|
17
20
|
end
|
18
|
-
@database = "#{@database_prefix}#{rabbitmq_host["displayname"]}"
|
19
|
-
@port = rabbitmq_host["port"]
|
20
21
|
@connection = Mongo::Connection.new(@host, @port)
|
21
22
|
end
|
22
23
|
|
data/lib/logger.rb
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
require 'log4r/yamlconfigurator'
|
3
|
+
require 'log4r/outputter/syslogoutputter'
|
4
|
+
|
5
|
+
class Logger
|
6
|
+
@@log = nil
|
7
|
+
def self.init(config)
|
8
|
+
if !@@log.nil?
|
9
|
+
return @@log
|
10
|
+
end
|
11
|
+
|
12
|
+
configurator = Log4r::YamlConfigurator
|
13
|
+
configurator.decode_yaml config.log_config
|
14
|
+
@@log = Log4r::Logger['main']
|
15
|
+
end
|
16
|
+
end
|
data/lib/rabbithutch.rb
CHANGED
@@ -33,6 +33,7 @@ require_relative "worker"
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
36
|
+
puts "\t...Consumers Initialized for #{rabbitmq_host["displayname"]}"
|
36
37
|
consumers
|
37
38
|
end
|
38
39
|
|
@@ -49,6 +50,7 @@ require_relative "worker"
|
|
49
50
|
AMQP.connect(:host => hostname, :user => username, :password => password) do |connection|
|
50
51
|
channel = AMQP::Channel.new(connection)
|
51
52
|
worker = RabbitHutch::Worker.new(channel, @config, consumers)
|
53
|
+
puts "ere"
|
52
54
|
worker.start
|
53
55
|
end
|
54
56
|
end
|
data/rabbithutch.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = %q{rabbithutch}
|
7
|
-
gem.version = "0.0.
|
7
|
+
gem.version = "0.0.8"
|
8
8
|
gem.authors = ["John Ryan"]
|
9
9
|
gem.email = ["555john@gmail.com"]
|
10
10
|
gem.description = %q{RabbitMq Trace Logger - Listen to multiple RabbitMq instances and log them to a
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rabbithutch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-12-
|
12
|
+
date: 2012-12-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: amqp
|
@@ -210,6 +210,7 @@ files:
|
|
210
210
|
- lib/consumers/console_consumer.rb
|
211
211
|
- lib/consumers/log4r_consumer.rb
|
212
212
|
- lib/consumers/mongo_consumer.rb
|
213
|
+
- lib/logger.rb
|
213
214
|
- lib/rabbithutch.rb
|
214
215
|
- lib/worker.rb
|
215
216
|
- rabbithutch.gemspec
|