beetle 3.5.0 → 3.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/RELEASE_NOTES.rdoc +4 -0
- data/lib/beetle/client.rb +6 -2
- data/lib/beetle/version.rb +1 -1
- data/test/beetle/client_test.rb +38 -3
- data/test/beetle/subscriber_test.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2dcaf90eaf1b11b7f6350bb34e17d73591616790ede7b43b6e98cef363dd3770
|
4
|
+
data.tar.gz: 55348c9ce61cc2f43869f9c12cd26bbc5dc033b0e0a0506c0a821d6a6e24862c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6daabfea72ab76b0fa6944d35cee52139678f9a02a272e86a32af6045750496ee81b96ff685eee1bbe9617030b981df3718b7569efabc98df59f894127da29d1
|
7
|
+
data.tar.gz: 04d599595b4c39e62a78b496b284a67bed1a545e759d9a094facc757e0334ed16e4bdd7bab4f7bfabb7b6f63da0e590351e86d0da55328ab6db898e9ceaaef7f
|
data/RELEASE_NOTES.rdoc
CHANGED
data/lib/beetle/client.rb
CHANGED
@@ -385,8 +385,12 @@ module Beetle
|
|
385
385
|
end
|
386
386
|
|
387
387
|
def load_brokers_from_config
|
388
|
-
@servers = config.servers
|
389
|
-
@additional_subscription_servers = config.additional_subscription_servers
|
388
|
+
@servers = parse_server_list(config.servers)
|
389
|
+
@additional_subscription_servers = parse_server_list(config.additional_subscription_servers) - @servers
|
390
|
+
end
|
391
|
+
|
392
|
+
def parse_server_list(s)
|
393
|
+
s.split(/ *, */).uniq.reject(&:blank?)
|
390
394
|
end
|
391
395
|
end
|
392
396
|
end
|
data/lib/beetle/version.rb
CHANGED
data/test/beetle/client_test.rb
CHANGED
@@ -343,17 +343,17 @@ module Beetle
|
|
343
343
|
|
344
344
|
test "trying to listen to an unknown queue should raise an exception" do
|
345
345
|
client = Client.new
|
346
|
-
assert_raises(UnknownQueue) {
|
346
|
+
assert_raises(UnknownQueue) { client.listen_queues([:foobar])}
|
347
347
|
end
|
348
348
|
|
349
349
|
test "trying to pause listening on an unknown queue should raise an exception" do
|
350
350
|
client = Client.new
|
351
|
-
assert_raises(UnknownQueue) {
|
351
|
+
assert_raises(UnknownQueue) { client.pause_listening(:foobar)}
|
352
352
|
end
|
353
353
|
|
354
354
|
test "trying to resume listening on an unknown queue should raise an exception" do
|
355
355
|
client = Client.new
|
356
|
-
assert_raises(UnknownQueue) {
|
356
|
+
assert_raises(UnknownQueue) { client.pause_listening(:foobar)}
|
357
357
|
end
|
358
358
|
|
359
359
|
test "should delegate stop_listening to the subscriber instance" do
|
@@ -457,4 +457,39 @@ module Beetle
|
|
457
457
|
msg_stub
|
458
458
|
end
|
459
459
|
end
|
460
|
+
|
461
|
+
class ServerDeduplicationTest < Minitest::Test
|
462
|
+
def setup
|
463
|
+
@config = Configuration.new
|
464
|
+
@config.servers = "localhost:5672,localhost:5672"
|
465
|
+
@config.additional_subscription_servers = @config.servers + ",localhost:1234,localhost:1234"
|
466
|
+
@client = Client.new(@config)
|
467
|
+
end
|
468
|
+
|
469
|
+
test "duplicates are removed from the server list" do
|
470
|
+
assert_equal ["localhost:5672"], @client.servers
|
471
|
+
end
|
472
|
+
|
473
|
+
test "duplicates and servers in the server list are removed from the additional subscription server list" do
|
474
|
+
assert_equal ["localhost:1234"], @client.additional_subscription_servers
|
475
|
+
end
|
476
|
+
end
|
477
|
+
|
478
|
+
class EmptyServerStringTest < Minitest::Test
|
479
|
+
def setup
|
480
|
+
@config = Configuration.new
|
481
|
+
@config.servers = "localhost:5672,\t,localhost:5672, "
|
482
|
+
@config.additional_subscription_servers = @config.servers + ",localhost:1234, , ,,"
|
483
|
+
@client = Client.new(@config)
|
484
|
+
end
|
485
|
+
|
486
|
+
test "empty strings are removed from the server list" do
|
487
|
+
assert_equal ["localhost:5672"], @client.servers
|
488
|
+
end
|
489
|
+
|
490
|
+
test "empty strings are removed from the additional subscription server list" do
|
491
|
+
assert_equal ["localhost:1234"], @client.additional_subscription_servers
|
492
|
+
end
|
493
|
+
end
|
494
|
+
|
460
495
|
end
|
@@ -127,7 +127,7 @@ module Beetle
|
|
127
127
|
@sub = @client.send(:subscriber)
|
128
128
|
end
|
129
129
|
|
130
|
-
test "subscribers server list should contain
|
130
|
+
test "subscribers server list should contain additional subcription hosts" do
|
131
131
|
assert_equal ["localhost:5672", "localhost:1234"], @sub.servers
|
132
132
|
end
|
133
133
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: beetle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Kaes
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2021-01
|
15
|
+
date: 2021-06-01 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bunny
|
@@ -378,7 +378,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
378
378
|
- !ruby/object:Gem::Version
|
379
379
|
version: 1.3.7
|
380
380
|
requirements: []
|
381
|
-
rubygems_version: 3.
|
381
|
+
rubygems_version: 3.2.16
|
382
382
|
signing_key:
|
383
383
|
specification_version: 3
|
384
384
|
summary: High Availability AMQP Messaging with Redundant Queues
|