ElmerFudd 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ElmerFudd.rb +11 -7
- data/lib/ElmerFudd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d9d2ada2ee87820d36525a99397eb2476c72179
|
4
|
+
data.tar.gz: 96dd5c76221121b4f1acdab2b7d09413919bac30
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1ace79990e9363063e2189a83a20bd7f93a2ac5c9f668acbee72fcff50f34738cf350edba08983f9530cff44d9e1858fc6ed35a2ec72b9342c53aeb31f28db7
|
7
|
+
data.tar.gz: 9f96a9703cf7f0ee756ef8126ac69d0a53812327a04347e666dc1f8aa1b4e4b69e33fd0ab01b962783e1608dc9d96c85019fb62093f1d9778f0d5875119472fe
|
data/lib/ElmerFudd.rb
CHANGED
@@ -59,15 +59,15 @@ module ElmerFudd
|
|
59
59
|
class Worker
|
60
60
|
Message = Struct.new(:delivery_info, :properties, :payload, :route)
|
61
61
|
Env = Struct.new(:channel, :logger)
|
62
|
-
Route = Struct.new(:exchange_name, :
|
62
|
+
Route = Struct.new(:exchange_name, :routing_keys, :queue_name)
|
63
63
|
|
64
64
|
def self.handlers
|
65
65
|
@handlers ||= []
|
66
66
|
end
|
67
67
|
|
68
|
-
def self.Route(queue_name,
|
69
|
-
exchange,
|
70
|
-
Route.new(exchange,
|
68
|
+
def self.Route(queue_name, exchange_and_routing_keys = {"" => queue_name})
|
69
|
+
exchange, routing_keys = exchange_and_routing_keys.first
|
70
|
+
Route.new(exchange, routing_keys, queue_name)
|
71
71
|
end
|
72
72
|
|
73
73
|
def self.default_filters(*filters)
|
@@ -131,7 +131,11 @@ module ElmerFudd
|
|
131
131
|
|
132
132
|
def queue(env)
|
133
133
|
env.channel.queue(@route.queue_name, durable: true).tap do |queue|
|
134
|
-
|
134
|
+
unless @route.exchange_name == ""
|
135
|
+
Array(@route.routing_keys).each do |routing_key|
|
136
|
+
queue.bind(exchange(env), routing_key: routing_key)
|
137
|
+
end
|
138
|
+
end
|
135
139
|
end
|
136
140
|
end
|
137
141
|
|
@@ -187,12 +191,12 @@ module ElmerFudd
|
|
187
191
|
def self.call(env, message, filters)
|
188
192
|
call_next(env, message, filters)
|
189
193
|
rescue Exception => e
|
190
|
-
Airbrake.notify(e,
|
194
|
+
Airbrake.notify(e, parameters: {
|
191
195
|
payload: message.payload,
|
192
196
|
queue: message.route.queue_name,
|
193
197
|
exchange_name: message.route.exchange_name,
|
194
198
|
routing_key: message.delivery_info.routing_key,
|
195
|
-
matched_routing_key: message.route.
|
199
|
+
matched_routing_key: message.route.routing_keys
|
196
200
|
})
|
197
201
|
raise
|
198
202
|
end
|
data/lib/ElmerFudd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ElmerFudd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrzej Sliwa
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-06-
|
12
|
+
date: 2014-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bunny
|