rabbithutch 0.0.2
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/.gitignore +24 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +55 -0
- data/LICENSE.txt +22 -0
- data/README.md +48 -0
- data/bin/rabbithutch +1 -0
- data/config.yaml +32 -0
- data/lib/configurator.rb +34 -0
- data/lib/consumer.rb +32 -0
- data/lib/consumers/console_consumer.rb +20 -0
- data/lib/consumers/log4r_consumer.rb +34 -0
- data/lib/consumers/mongo_consumer.rb +33 -0
- data/lib/logger.rb +18 -0
- data/lib/rabbithutch.rb +83 -0
- data/lib/worker.rb +32 -0
- data/rabbithutch.gemspec +36 -0
- data/rabbithutchservice.rb +16 -0
- data/rakefile +5 -0
- metadata +277 -0
data/.gitignore
ADDED
@@ -0,0 +1,24 @@
|
|
1
|
+
*~
|
2
|
+
*.gem
|
3
|
+
*.rbc
|
4
|
+
.bundle
|
5
|
+
.config
|
6
|
+
coverage
|
7
|
+
InstalledFiles
|
8
|
+
lib/bundler/man
|
9
|
+
pkg
|
10
|
+
rdoc
|
11
|
+
spec/reports
|
12
|
+
test/tmp
|
13
|
+
test/version_tmp
|
14
|
+
tmp
|
15
|
+
|
16
|
+
# YARD artifacts
|
17
|
+
.yardoc
|
18
|
+
_yardoc
|
19
|
+
doc/
|
20
|
+
|
21
|
+
.project
|
22
|
+
*.pid
|
23
|
+
|
24
|
+
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,55 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
rabbithutch (0.0.1)
|
5
|
+
amqp
|
6
|
+
bson_ext
|
7
|
+
daemons
|
8
|
+
eventmachine
|
9
|
+
log4r
|
10
|
+
logger
|
11
|
+
logger
|
12
|
+
mongo
|
13
|
+
mongo_ext
|
14
|
+
mq
|
15
|
+
redcarpet
|
16
|
+
thor
|
17
|
+
yard
|
18
|
+
|
19
|
+
GEM
|
20
|
+
remote: https://rubygems.org/
|
21
|
+
specs:
|
22
|
+
activesupport (3.2.9)
|
23
|
+
i18n (~> 0.6)
|
24
|
+
multi_json (~> 1.0)
|
25
|
+
amq-client (0.9.9)
|
26
|
+
amq-protocol (>= 0.9.4)
|
27
|
+
eventmachine
|
28
|
+
amq-protocol (1.0.0)
|
29
|
+
amqp (0.9.8)
|
30
|
+
amq-client (~> 0.9.5)
|
31
|
+
amq-protocol (>= 0.9.4)
|
32
|
+
eventmachine
|
33
|
+
bson (1.8.0)
|
34
|
+
activesupport
|
35
|
+
bson_ext (1.8.0)
|
36
|
+
bson (~> 1.8.0)
|
37
|
+
daemons (1.1.9)
|
38
|
+
eventmachine (1.0.0)
|
39
|
+
i18n (0.6.1)
|
40
|
+
log4r (1.1.10)
|
41
|
+
logger (1.2.8)
|
42
|
+
mongo (1.8.0)
|
43
|
+
bson (~> 1.8.0)
|
44
|
+
mongo_ext (0.19.3)
|
45
|
+
mq (0.1.3)
|
46
|
+
multi_json (1.3.7)
|
47
|
+
redcarpet (2.2.2)
|
48
|
+
thor (0.16.0)
|
49
|
+
yard (0.8.3)
|
50
|
+
|
51
|
+
PLATFORMS
|
52
|
+
ruby
|
53
|
+
|
54
|
+
DEPENDENCIES
|
55
|
+
rabbithutch!
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2012 John Ryan
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
#rabbit-hutch
|
2
|
+
|
3
|
+
RabbitMq Trace Logger
|
4
|
+
|
5
|
+
# Overview
|
6
|
+
|
7
|
+
This is a ruby service for monotoring the trace output on RabbitMq Nodes and writing the output to console, Log files or MongoDb
|
8
|
+
|
9
|
+
#Technologies Used
|
10
|
+
|
11
|
+
*Ruby
|
12
|
+
*Deamonizr
|
13
|
+
|
14
|
+
# Setup & Installation
|
15
|
+
|
16
|
+
gem install rabbithutch
|
17
|
+
|
18
|
+
Run as a command line process
|
19
|
+
rabbithutch run
|
20
|
+
|
21
|
+
Run as a service
|
22
|
+
rabbithutch start
|
23
|
+
|
24
|
+
For help
|
25
|
+
rabbithutch
|
26
|
+
|
27
|
+
#Contributing
|
28
|
+
|
29
|
+
Fork it
|
30
|
+
Create your feature branch (git checkout -b my-new-feature)
|
31
|
+
Commit your changes (git commit -am 'Add some feature')
|
32
|
+
Push to the branch (git push origin my-new-feature)
|
33
|
+
Create new Pull Request
|
34
|
+
|
35
|
+
## Create the gem
|
36
|
+
|
37
|
+
Build and Test Locally
|
38
|
+
-gem build rabbithutch.gemspec
|
39
|
+
-gem install rabbithutch-X.X.X # where X.X.X is the version of the compiled gemspec
|
40
|
+
|
41
|
+
Build and deploy to rubygems.org
|
42
|
+
-gem update --system
|
43
|
+
-gem build rabbithutch.gemspec
|
44
|
+
-gem push rabbithutch-0.0.1.gem # where X.X.X is the version of the compiled gemspec
|
45
|
+
|
46
|
+
|
47
|
+
References
|
48
|
+
|
data/bin/rabbithutch
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require_relative '../rabbithutchservice.rb'
|
data/config.yaml
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
application:
|
2
|
+
exchangename: amq.rabbitmq.trace
|
3
|
+
queuename: rabbithutch
|
4
|
+
|
5
|
+
rabbitmq:
|
6
|
+
hosts:
|
7
|
+
- displayname: local1
|
8
|
+
enabled: true
|
9
|
+
hostname: 127.0.0.1
|
10
|
+
username: guest
|
11
|
+
password: guest
|
12
|
+
- displayname: local2
|
13
|
+
enabled: false
|
14
|
+
hostname: 127.0.0.1
|
15
|
+
username: guest
|
16
|
+
password: guest
|
17
|
+
|
18
|
+
consumers_config:
|
19
|
+
consumers:
|
20
|
+
- name: console_consumer
|
21
|
+
enabled: false
|
22
|
+
- name: mongo_consumer
|
23
|
+
enabled: true
|
24
|
+
hostname: 127.0.0.1
|
25
|
+
username: guest
|
26
|
+
password: guest
|
27
|
+
database_prefix: rhutch_
|
28
|
+
port: 27017
|
29
|
+
- name: log4r_consumer
|
30
|
+
enabled: true
|
31
|
+
log_location: /tmp
|
32
|
+
log_prefix: rhutch_
|
data/lib/configurator.rb
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
require 'yaml'
|
2
|
+
|
3
|
+
module RabbitHutch
|
4
|
+
class Configurator
|
5
|
+
|
6
|
+
attr_accessor :config
|
7
|
+
|
8
|
+
def initialize options
|
9
|
+
file = options[:config_path] || (File.dirname(__FILE__) + '/../config.yaml')
|
10
|
+
unless File.exists? file
|
11
|
+
raise "Configuration file [#{file}] doesn't exist"
|
12
|
+
end
|
13
|
+
@config = YAML::load(File.open(file))
|
14
|
+
end
|
15
|
+
|
16
|
+
def application
|
17
|
+
@config['application']
|
18
|
+
end
|
19
|
+
|
20
|
+
def log_config
|
21
|
+
@config['log4r_config']
|
22
|
+
end
|
23
|
+
|
24
|
+
def consumers
|
25
|
+
@config['consumers_config']["consumers"]
|
26
|
+
end
|
27
|
+
|
28
|
+
def rabbitmq_hosts
|
29
|
+
@config['rabbitmq']['hosts']
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
data/lib/consumer.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require_relative "configurator"
|
3
|
+
require_relative "consumers/mongo_consumer"
|
4
|
+
|
5
|
+
module RabbitHutch
|
6
|
+
# Controls the consumers that are to be kicked off based on the config file
|
7
|
+
class Consumer
|
8
|
+
def initialize(consumers)
|
9
|
+
@consumers = consumers
|
10
|
+
end
|
11
|
+
|
12
|
+
# Raised on receipt of a message from RabbitMq and uses the appropriate appender
|
13
|
+
def handle_message(metadata, payload)
|
14
|
+
# loop through appenders and fire each as required
|
15
|
+
@consumers.each do |consumer|
|
16
|
+
action = metadata.routing_key.split('.', 2).first
|
17
|
+
if(action == "publish")
|
18
|
+
exchange = metadata.attributes[:headers]["exchange_name"]
|
19
|
+
queue = metadata.routing_key.split('.', 2).last
|
20
|
+
item = {:date => Time.now,
|
21
|
+
:exchange => exchange,
|
22
|
+
:queue => queue,
|
23
|
+
:routing_keys => metadata.attributes[:headers]["routing_keys"].inspect,
|
24
|
+
:attributes => metadata.attributes.inspect,
|
25
|
+
:payload => payload.inspect
|
26
|
+
}
|
27
|
+
consumer.log_event(item)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require "mongo"
|
4
|
+
|
5
|
+
module RabbitHutch
|
6
|
+
class ConsoleConsumer
|
7
|
+
|
8
|
+
def initialize()
|
9
|
+
puts "\tInitializing Console Consumer"
|
10
|
+
end
|
11
|
+
|
12
|
+
def log_event(item)
|
13
|
+
begin
|
14
|
+
puts item
|
15
|
+
rescue Exception => e
|
16
|
+
puts "Error occurred Message Handler trying to write messages to Log #{e.inspect}"
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require 'log4r'
|
4
|
+
#require 'log4r/outputter/syslogoutputter'
|
5
|
+
|
6
|
+
module RabbitHutch
|
7
|
+
class Log4rConsumer
|
8
|
+
|
9
|
+
def initialize(rabbitmq_host, config)
|
10
|
+
puts "\tInitializing Log4r Consumer"
|
11
|
+
@rabbitmq_host = rabbitmq_host
|
12
|
+
@config = config
|
13
|
+
@log_name = rabbitmq_host["displayname"]
|
14
|
+
@config.consumers.each do |consumer|
|
15
|
+
if consumer["name"] == 'log4r_consumer'
|
16
|
+
@log_prefix = consumer['log_prefix']
|
17
|
+
@log_location = consumer['log_location']
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
@logger = Log4r::Logger.new("#{@log_name}#_log")
|
22
|
+
@logger.outputters << Log4r::FileOutputter.new("#{@log_name}_filelog", :filename => "#{@log_location}/#{@log_prefix}#{@log_name}.log")
|
23
|
+
end
|
24
|
+
|
25
|
+
def log_event(item)
|
26
|
+
begin
|
27
|
+
@logger.info(item)
|
28
|
+
rescue Exception => e
|
29
|
+
puts "Error occurred Message Handler trying to write messages to Log #{e.inspect}"
|
30
|
+
#@log.error("Error occurred Message Handler trying to write messages to MONGODB #{e.inspect}")
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
require "mongo"
|
4
|
+
|
5
|
+
module RabbitHutch
|
6
|
+
class MongoConsumer
|
7
|
+
|
8
|
+
def initialize(rabbitmq_host, config)
|
9
|
+
puts "\tInitializing MongoDb Consumer"
|
10
|
+
@config = config
|
11
|
+
@rabbitmq_host = rabbitmq_host
|
12
|
+
@host = rabbitmq_host["hostname"]
|
13
|
+
@config.consumers.each do |consumer|
|
14
|
+
if consumer["name"] == 'mongo_consumer'
|
15
|
+
@database_prefix = consumer['database_prefix']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
@database = "#{@database_prefix}#{rabbitmq_host["displayname"]}"
|
19
|
+
@port = rabbitmq_host["port"]
|
20
|
+
@connection = Mongo::Connection.new(@host, @port)
|
21
|
+
end
|
22
|
+
|
23
|
+
def log_event(item)
|
24
|
+
begin
|
25
|
+
db = @connection.db(@database)
|
26
|
+
coll = db.collection(item[:exchange])
|
27
|
+
coll.insert(item)
|
28
|
+
rescue Exception => e
|
29
|
+
puts "Error occurred Message Handler trying to write messages to MONGODB #{e.inspect}"
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
data/lib/logger.rb
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
require 'log4r/yamlconfigurator'
|
3
|
+
require 'log4r/outputter/syslogoutputter'
|
4
|
+
|
5
|
+
module RabbitHutch
|
6
|
+
class MyLogger
|
7
|
+
@@log = nil
|
8
|
+
def self.init(config)
|
9
|
+
if !@@log.nil?
|
10
|
+
return @@log
|
11
|
+
end
|
12
|
+
|
13
|
+
configurator = Log4r::YamlConfigurator
|
14
|
+
configurator.decode_yaml config.log_config
|
15
|
+
@@log = Log4r::Logger['main']
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
data/lib/rabbithutch.rb
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require "amqp"
|
3
|
+
require_relative "configurator"
|
4
|
+
require_relative "consumers/mongo_consumer"
|
5
|
+
require_relative "consumers/log4r_consumer"
|
6
|
+
require_relative "consumers/console_consumer"
|
7
|
+
require_relative "worker"
|
8
|
+
|
9
|
+
@config = RabbitHutch::Configurator.new({})
|
10
|
+
@log = nil #RabbitHutch::MyLogger.init(@config)
|
11
|
+
|
12
|
+
puts "-------------------------"
|
13
|
+
puts "Starting RabbitHutch"
|
14
|
+
puts "\tEnvironment Settings"
|
15
|
+
@config.rabbitmq_hosts.each do |rabbitmq_host|
|
16
|
+
puts "\tDisplay Name: #{rabbitmq_host["displayname"]}, host: #{rabbitmq_host["hostname"]}, username: #{rabbitmq_host["username"]}, enabled #{rabbitmq_host["enabled"]}"
|
17
|
+
end
|
18
|
+
|
19
|
+
# Initialize all enabled consumners
|
20
|
+
# NOTE: this method will be replaced with a routine to reflect through all valid consumers and initialze them implicitly
|
21
|
+
def initialize_consumers(rabbitmq_host)
|
22
|
+
puts "Initializing Consumers for #{rabbitmq_host["displayname"]}"
|
23
|
+
consumers = []
|
24
|
+
@config.consumers.each do |consumer|
|
25
|
+
if consumer["enabled"] == true
|
26
|
+
case consumer["name"]
|
27
|
+
when "console_consumer"
|
28
|
+
consumers << RabbitHutch::ConsoleConsumer.new()
|
29
|
+
when "mongo_consumer"
|
30
|
+
consumers << RabbitHutch::MongoConsumer.new(rabbitmq_host, @config)
|
31
|
+
when "log4r_consumer"
|
32
|
+
consumers << RabbitHutch::Log4rConsumer.new(rabbitmq_host, @config)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
consumers
|
37
|
+
end
|
38
|
+
|
39
|
+
# Start the worker process to listen to a RabbitMq Node
|
40
|
+
def start_worker(rabbitmq_host)
|
41
|
+
displayname = rabbitmq_host["displayname"]
|
42
|
+
hostname = rabbitmq_host["hostname"]
|
43
|
+
username = rabbitmq_host["username"]
|
44
|
+
password = rabbitmq_host["password"]
|
45
|
+
|
46
|
+
consumers = initialize_consumers(rabbitmq_host)
|
47
|
+
|
48
|
+
puts "\tListening to RabbitMq #{displayname}, host: #{hostname}, username #{username}"
|
49
|
+
AMQP.connect(:host => hostname, :user => username, :password => password) do |connection|
|
50
|
+
channel = AMQP::Channel.new(connection)
|
51
|
+
worker = RabbitHutch::Worker.new(channel, @config, consumers)
|
52
|
+
worker.start
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Entry Point to the application, Begins queue listener and initializes all consmers
|
57
|
+
def start
|
58
|
+
begin
|
59
|
+
#initialize_consumers
|
60
|
+
|
61
|
+
EventMachine.run do
|
62
|
+
puts "Initializing RabbitMq Listener"
|
63
|
+
@config.rabbitmq_hosts.each do |rabbitmq_host|
|
64
|
+
if rabbitmq_host["enabled"] == true
|
65
|
+
start_worker(rabbitmq_host)
|
66
|
+
end
|
67
|
+
end
|
68
|
+
Signal.trap("INT"){EventMachine.stop}
|
69
|
+
Signal.trap("QUIT"){EventMachine.stop}
|
70
|
+
Signal.trap("TERM"){EventMachine.stop}
|
71
|
+
Signal.trap("TSTP"){EventMachine.stop}
|
72
|
+
end
|
73
|
+
rescue Exception=>e
|
74
|
+
puts "#{e.message} #{e.backtrace}"
|
75
|
+
#@log.error("#{e.message} #{e.backtrace}")
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
# Kick off the App
|
80
|
+
start
|
81
|
+
|
82
|
+
|
83
|
+
|
data/lib/worker.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require "rubygems"
|
2
|
+
require "amqp"
|
3
|
+
require_relative "configurator"
|
4
|
+
require_relative "consumer"
|
5
|
+
|
6
|
+
module RabbitHutch
|
7
|
+
@exchange_name = "amq.rabbitmq.trace"
|
8
|
+
|
9
|
+
class Worker
|
10
|
+
|
11
|
+
def initialize(channel, config, consumers)
|
12
|
+
@channel = channel
|
13
|
+
@channel.on_error(&method(:handle_channel_exception))
|
14
|
+
@consumer = Consumer.new(consumers)
|
15
|
+
@exchange_name = config.application['exchangename']
|
16
|
+
@queue_name = config.application['queuename']
|
17
|
+
end
|
18
|
+
|
19
|
+
def start
|
20
|
+
@exchange = @channel.topic(@exchange_name, :durable => true, :auto_delete => false, :internal => true)
|
21
|
+
@queue = @channel.queue(@queue_name, :durable => false, :auto_delete => true)
|
22
|
+
@queue.bind(@exchange, :routing_key => '#')
|
23
|
+
@queue.subscribe(&@consumer.method(:handle_message))
|
24
|
+
end
|
25
|
+
|
26
|
+
def handle_channel_exception(channel, channel_close)
|
27
|
+
puts "Oops... a channel-level exception: code = #{channel_close.reply_code}, message = #{channel_close.reply_text}"
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
|
32
|
+
end
|
data/rabbithutch.gemspec
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |gem|
|
6
|
+
gem.name = %q{rabbithutch}
|
7
|
+
gem.version = "0.0.2"
|
8
|
+
gem.authors = ["John Ryan"]
|
9
|
+
gem.email = ["555john@gmail.com"]
|
10
|
+
gem.description = %q{RabbitMq Trace Logger}
|
11
|
+
gem.summary = %q{This is a ruby service for monotoring the trace output on RabbitMq Nodes and writing the output to console, Log files or MongoDb}
|
12
|
+
gem.homepage = %q{http://github.com/jnyryan/}
|
13
|
+
|
14
|
+
gem.extra_rdoc_files = ["LICENSE.txt","README.md" ]
|
15
|
+
gem.files = `git ls-files`.split($/)
|
16
|
+
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
|
+
gem.executable = 'rabbithutch'
|
18
|
+
gem.require_paths = ["lib"]
|
19
|
+
|
20
|
+
gem.rdoc_options << '--exclude spec/testfiles'
|
21
|
+
|
22
|
+
gem.add_dependency "logger"
|
23
|
+
gem.add_dependency "amqp"
|
24
|
+
gem.add_dependency "bson_ext"
|
25
|
+
gem.add_dependency "daemons"
|
26
|
+
gem.add_dependency "eventmachine"
|
27
|
+
gem.add_dependency "logger"
|
28
|
+
gem.add_dependency "log4r"
|
29
|
+
gem.add_dependency "mq"
|
30
|
+
gem.add_dependency "mongo"
|
31
|
+
gem.add_dependency "mongo_ext"
|
32
|
+
gem.add_dependency "redcarpet"
|
33
|
+
gem.add_dependency "thor"
|
34
|
+
gem.add_dependency "yard"
|
35
|
+
|
36
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'daemons'
|
3
|
+
|
4
|
+
# The Service controller.
|
5
|
+
def start_service
|
6
|
+
begin
|
7
|
+
Daemons.run(File.dirname(__FILE__) + '/lib/rabbithutch.rb')
|
8
|
+
rescue SystemExit=>e
|
9
|
+
puts e.inspect
|
10
|
+
rescue Exception=>e
|
11
|
+
puts e.inspect
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
start_service()
|
16
|
+
|
metadata
ADDED
@@ -0,0 +1,277 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rabbithutch
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.2
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- John Ryan
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-12-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: logger
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>='
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: amqp
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: bson_ext
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :runtime
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: daemons
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :runtime
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: eventmachine
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :runtime
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: logger
|
96
|
+
requirement: !ruby/object:Gem::Requirement
|
97
|
+
none: false
|
98
|
+
requirements:
|
99
|
+
- - ! '>='
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '0'
|
102
|
+
type: :runtime
|
103
|
+
prerelease: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
105
|
+
none: false
|
106
|
+
requirements:
|
107
|
+
- - ! '>='
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
- !ruby/object:Gem::Dependency
|
111
|
+
name: log4r
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
113
|
+
none: false
|
114
|
+
requirements:
|
115
|
+
- - ! '>='
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :runtime
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
none: false
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: mq
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
none: false
|
130
|
+
requirements:
|
131
|
+
- - ! '>='
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
version: '0'
|
134
|
+
type: :runtime
|
135
|
+
prerelease: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
137
|
+
none: false
|
138
|
+
requirements:
|
139
|
+
- - ! '>='
|
140
|
+
- !ruby/object:Gem::Version
|
141
|
+
version: '0'
|
142
|
+
- !ruby/object:Gem::Dependency
|
143
|
+
name: mongo
|
144
|
+
requirement: !ruby/object:Gem::Requirement
|
145
|
+
none: false
|
146
|
+
requirements:
|
147
|
+
- - ! '>='
|
148
|
+
- !ruby/object:Gem::Version
|
149
|
+
version: '0'
|
150
|
+
type: :runtime
|
151
|
+
prerelease: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
153
|
+
none: false
|
154
|
+
requirements:
|
155
|
+
- - ! '>='
|
156
|
+
- !ruby/object:Gem::Version
|
157
|
+
version: '0'
|
158
|
+
- !ruby/object:Gem::Dependency
|
159
|
+
name: mongo_ext
|
160
|
+
requirement: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
162
|
+
requirements:
|
163
|
+
- - ! '>='
|
164
|
+
- !ruby/object:Gem::Version
|
165
|
+
version: '0'
|
166
|
+
type: :runtime
|
167
|
+
prerelease: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
169
|
+
none: false
|
170
|
+
requirements:
|
171
|
+
- - ! '>='
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: redcarpet
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
none: false
|
178
|
+
requirements:
|
179
|
+
- - ! '>='
|
180
|
+
- !ruby/object:Gem::Version
|
181
|
+
version: '0'
|
182
|
+
type: :runtime
|
183
|
+
prerelease: false
|
184
|
+
version_requirements: !ruby/object:Gem::Requirement
|
185
|
+
none: false
|
186
|
+
requirements:
|
187
|
+
- - ! '>='
|
188
|
+
- !ruby/object:Gem::Version
|
189
|
+
version: '0'
|
190
|
+
- !ruby/object:Gem::Dependency
|
191
|
+
name: thor
|
192
|
+
requirement: !ruby/object:Gem::Requirement
|
193
|
+
none: false
|
194
|
+
requirements:
|
195
|
+
- - ! '>='
|
196
|
+
- !ruby/object:Gem::Version
|
197
|
+
version: '0'
|
198
|
+
type: :runtime
|
199
|
+
prerelease: false
|
200
|
+
version_requirements: !ruby/object:Gem::Requirement
|
201
|
+
none: false
|
202
|
+
requirements:
|
203
|
+
- - ! '>='
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
- !ruby/object:Gem::Dependency
|
207
|
+
name: yard
|
208
|
+
requirement: !ruby/object:Gem::Requirement
|
209
|
+
none: false
|
210
|
+
requirements:
|
211
|
+
- - ! '>='
|
212
|
+
- !ruby/object:Gem::Version
|
213
|
+
version: '0'
|
214
|
+
type: :runtime
|
215
|
+
prerelease: false
|
216
|
+
version_requirements: !ruby/object:Gem::Requirement
|
217
|
+
none: false
|
218
|
+
requirements:
|
219
|
+
- - ! '>='
|
220
|
+
- !ruby/object:Gem::Version
|
221
|
+
version: '0'
|
222
|
+
description: RabbitMq Trace Logger
|
223
|
+
email:
|
224
|
+
- 555john@gmail.com
|
225
|
+
executables:
|
226
|
+
- rabbithutch
|
227
|
+
extensions: []
|
228
|
+
extra_rdoc_files:
|
229
|
+
- LICENSE.txt
|
230
|
+
- README.md
|
231
|
+
files:
|
232
|
+
- .gitignore
|
233
|
+
- Gemfile
|
234
|
+
- Gemfile.lock
|
235
|
+
- LICENSE.txt
|
236
|
+
- README.md
|
237
|
+
- bin/rabbithutch
|
238
|
+
- config.yaml
|
239
|
+
- lib/configurator.rb
|
240
|
+
- lib/consumer.rb
|
241
|
+
- lib/consumers/console_consumer.rb
|
242
|
+
- lib/consumers/log4r_consumer.rb
|
243
|
+
- lib/consumers/mongo_consumer.rb
|
244
|
+
- lib/logger.rb
|
245
|
+
- lib/rabbithutch.rb
|
246
|
+
- lib/worker.rb
|
247
|
+
- rabbithutch.gemspec
|
248
|
+
- rabbithutchservice.rb
|
249
|
+
- rakefile
|
250
|
+
homepage: http://github.com/jnyryan/
|
251
|
+
licenses: []
|
252
|
+
post_install_message:
|
253
|
+
rdoc_options:
|
254
|
+
- --exclude spec/testfiles
|
255
|
+
require_paths:
|
256
|
+
- lib
|
257
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
258
|
+
none: false
|
259
|
+
requirements:
|
260
|
+
- - ! '>='
|
261
|
+
- !ruby/object:Gem::Version
|
262
|
+
version: '0'
|
263
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
|
+
none: false
|
265
|
+
requirements:
|
266
|
+
- - ! '>='
|
267
|
+
- !ruby/object:Gem::Version
|
268
|
+
version: '0'
|
269
|
+
requirements: []
|
270
|
+
rubyforge_project:
|
271
|
+
rubygems_version: 1.8.24
|
272
|
+
signing_key:
|
273
|
+
specification_version: 3
|
274
|
+
summary: This is a ruby service for monotoring the trace output on RabbitMq Nodes
|
275
|
+
and writing the output to console, Log files or MongoDb
|
276
|
+
test_files: []
|
277
|
+
has_rdoc:
|