pwwka 0.15.1 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +3 -3
- data/README.md +1 -1
- data/lib/pwwka/receiver.rb +1 -1
- data/lib/pwwka/version.rb +1 -1
- data/spec/integration/send_and_receive_spec.rb +8 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9979d197bd12e7850a2152c42d788220d11b280
|
4
|
+
data.tar.gz: 4dcaaaee90025accb128ac6eb2c5676fd7dd714b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 653875f4ed5231099fff06769f231cbcfa786db1bb0900364dba0928b1e4921f3cea8d4699126d7b0c80ec51438d88b924e5f863c9ec448ee940a7d4a0ff1492
|
7
|
+
data.tar.gz: 40e334288cd1a6bbdb940583f4f9d50ee5f527d28ec3479eb822a78219faf33930d525859bfbb5c6a2785167ac29d669262c7caa41543da893b93055792bc821
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
pwwka (0.
|
4
|
+
pwwka (0.16.0)
|
5
5
|
activemodel
|
6
6
|
activesupport
|
7
7
|
bunny
|
@@ -18,14 +18,14 @@ GEM
|
|
18
18
|
minitest (~> 5.1)
|
19
19
|
tzinfo (~> 1.1)
|
20
20
|
amq-protocol (2.2.0)
|
21
|
-
bunny (2.
|
21
|
+
bunny (2.8.0)
|
22
22
|
amq-protocol (>= 2.2.0)
|
23
23
|
concurrent-ruby (1.0.5)
|
24
24
|
diff-lcs (1.3)
|
25
25
|
docile (1.1.5)
|
26
26
|
et-orbi (1.0.7)
|
27
27
|
tzinfo
|
28
|
-
i18n (0.9.
|
28
|
+
i18n (0.9.1)
|
29
29
|
concurrent-ruby (~> 1.0)
|
30
30
|
json (2.1.0)
|
31
31
|
minitest (5.10.3)
|
data/README.md
CHANGED
@@ -211,7 +211,7 @@ It requires some environment variables to work:
|
|
211
211
|
|
212
212
|
* `HANDLER_KLASS` (required) refers to the class you have to write in your app (equivalent to a `job` in Resque)
|
213
213
|
* `QUEUE_NAME` (required) we must use named queues - see below
|
214
|
-
* `ROUTING_KEY` (optional) defaults to `#.#` (all messages)
|
214
|
+
* `ROUTING_KEY` (optional) comma separated list of routing keys (e.g. `foo.bar.*,foo.baz.*`). defaults to `#.#` (all messages)
|
215
215
|
* `PREFETCH` (optional) sets a [prefetch value](http://rubybunny.info/articles/queues.html#qos__prefetching_messages) for the subscriber
|
216
216
|
|
217
217
|
You'll also need to bring the Rake task into your app. For Rails, you'll need to edit the top-level `Rakefile`:
|
data/lib/pwwka/receiver.rb
CHANGED
@@ -51,7 +51,7 @@ module Pwwka
|
|
51
51
|
def topic_queue
|
52
52
|
@topic_queue ||= begin
|
53
53
|
queue = channel.queue(queue_name, durable: true, arguments: {})
|
54
|
-
queue.bind(topic_exchange, routing_key:
|
54
|
+
routing_key.split(',').each { |k| queue.bind(topic_exchange, routing_key: k) }
|
55
55
|
queue
|
56
56
|
end
|
57
57
|
end
|
data/lib/pwwka/version.rb
CHANGED
@@ -19,6 +19,7 @@ describe "sending and receiving messages", :integration do
|
|
19
19
|
|
20
20
|
[AllReceiver , "all_receiver_pwwkatesting" , "#"] ,
|
21
21
|
[FooReceiver , "foo_receiver_pwwkatesting" , "pwwka.testing.foo"] ,
|
22
|
+
[MultiRoutingReceived , "multi_routing_receiver_pwwkatesting" , "pwwka.testing.bar,pwwka.testing.foo"] ,
|
22
23
|
[OtherFooReceiver , "other_foo_receiver_pwwkatesting" , "pwwka.testing.foo"] ,
|
23
24
|
[Pwwka::QueueResqueJobHandler , "queue_resque_job_handler_pwwkatesting" , "#" ] ,
|
24
25
|
|
@@ -27,6 +28,7 @@ describe "sending and receiving messages", :integration do
|
|
27
28
|
end
|
28
29
|
AllReceiver.reset!
|
29
30
|
FooReceiver.reset!
|
31
|
+
MultiRoutingReceived.reset!
|
30
32
|
OtherFooReceiver.reset!
|
31
33
|
clear_queue(:delayed)
|
32
34
|
clear_queue(MyTestJob)
|
@@ -46,6 +48,7 @@ describe "sending and receiving messages", :integration do
|
|
46
48
|
|
47
49
|
expect(AllReceiver.messages_received.size).to eq(1)
|
48
50
|
expect(FooReceiver.messages_received.size).to eq(1)
|
51
|
+
expect(MultiRoutingReceived.messages_received.size).to eq(1)
|
49
52
|
expect(OtherFooReceiver.messages_received.size).to eq(1)
|
50
53
|
@testing_setup.queues.each do |queue|
|
51
54
|
expect(queue.message_count).to eq(0)
|
@@ -58,6 +61,7 @@ describe "sending and receiving messages", :integration do
|
|
58
61
|
|
59
62
|
expect(AllReceiver.messages_received.size).to eq(1)
|
60
63
|
expect(FooReceiver.messages_received.size).to eq(0)
|
64
|
+
expect(MultiRoutingReceived.messages_received.size).to eq(1)
|
61
65
|
expect(OtherFooReceiver.messages_received.size).to eq(0)
|
62
66
|
@testing_setup.queues.each do |queue|
|
63
67
|
expect(queue.message_count).to eq(0)
|
@@ -200,11 +204,13 @@ describe "sending and receiving messages", :integration do
|
|
200
204
|
|
201
205
|
expect(AllReceiver.messages_received.size).to eq(0)
|
202
206
|
expect(FooReceiver.messages_received.size).to eq(0)
|
207
|
+
expect(MultiRoutingReceived.messages_received.size).to eq(0)
|
203
208
|
expect(OtherFooReceiver.messages_received.size).to eq(0)
|
204
209
|
|
205
210
|
allow_receivers_to_process_queues(5_000)
|
206
211
|
expect(AllReceiver.messages_received.size).to eq(1)
|
207
212
|
expect(FooReceiver.messages_received.size).to eq(1)
|
213
|
+
expect(MultiRoutingReceived.messages_received.size).to eq(1)
|
208
214
|
expect(OtherFooReceiver.messages_received.size).to eq(1)
|
209
215
|
end
|
210
216
|
|
@@ -241,4 +247,6 @@ describe "sending and receiving messages", :integration do
|
|
241
247
|
end
|
242
248
|
class OtherFooReceiver < AllReceiver
|
243
249
|
end
|
250
|
+
class MultiRoutingReceived < AllReceiver
|
251
|
+
end
|
244
252
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pwwka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stitch Fix Engineering
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2017-12-
|
18
|
+
date: 2017-12-18 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bunny
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
version: '0'
|
269
269
|
requirements: []
|
270
270
|
rubyforge_project:
|
271
|
-
rubygems_version: 2.
|
271
|
+
rubygems_version: 2.5.1
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Send and receive messages via RabbitMQ
|