beetle 3.5.5 → 3.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/features/support/env.rb +1 -1
- data/features/support/test_daemons/redis.rb +4 -4
- data/lib/beetle/version.rb +1 -1
- data/lib/beetle.rb +6 -0
- data/test/beetle/bunny_behavior_test.rb +32 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 05c783e8ae2cd39837e587954e252f6f8cd772756536cb51de030fdebddfa808
|
4
|
+
data.tar.gz: 63403a3e7c70a2840daedfbb41f067c260ac6ae0b34920334f0e26bb999b936b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c43c533f5946971f25cbc664809842498f0e52b0404e0a23b772940707adf53288be74d7ca1f8f3cae1943a1d311a19f15b2fc4e3458b6347597367002e65af0
|
7
|
+
data.tar.gz: ae915f36ce7d9e78a10421b17bca59710b87964b3904db14ea1064dc6d87147d3e9c2faf6b552982d73ed227e88b4bd8b2d06d4a9d8335654d6008c95eade00b
|
data/features/support/env.rb
CHANGED
@@ -131,11 +131,11 @@ module TestDaemons
|
|
131
131
|
private
|
132
132
|
|
133
133
|
def create_dir
|
134
|
-
FileUtils.mkdir(dir) unless File.
|
134
|
+
FileUtils.mkdir(dir) unless File.exist?(dir)
|
135
135
|
end
|
136
136
|
|
137
137
|
def remove_dir
|
138
|
-
FileUtils.rm_r(dir) if File.
|
138
|
+
FileUtils.rm_r(dir) if File.exist?(dir)
|
139
139
|
end
|
140
140
|
|
141
141
|
def create_config
|
@@ -145,11 +145,11 @@ module TestDaemons
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def remove_config
|
148
|
-
FileUtils.rm(config_filename) if File.
|
148
|
+
FileUtils.rm(config_filename) if File.exist?(config_filename)
|
149
149
|
end
|
150
150
|
|
151
151
|
def remove_pid_file
|
152
|
-
FileUtils.rm(pid_file) if File.
|
152
|
+
FileUtils.rm(pid_file) if File.exist?(pid_file)
|
153
153
|
end
|
154
154
|
|
155
155
|
def tmp_path
|
data/lib/beetle/version.rb
CHANGED
data/lib/beetle.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
$:.unshift(File.expand_path('..', __FILE__))
|
2
2
|
require 'bunny' # which bunny picks up
|
3
3
|
require 'qrack/errors' # needed by the publisher
|
4
|
+
|
5
|
+
if Gem::Version.new(Bunny::VERSION) <= Gem::Version.new("0.7.12") && !defined?(::Fixnum)
|
6
|
+
require 'qrack/transport/buffer09'
|
7
|
+
Qrack::Transport09::Buffer.class_eval "Fixnum = Integer"
|
8
|
+
end
|
9
|
+
|
4
10
|
begin
|
5
11
|
require 'redis/connection/hiredis' # require *before* redis as specified in the redis-rb gem docs
|
6
12
|
require 'redis'
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path(File.dirname(__FILE__) + '/../test_helper')
|
2
|
+
|
3
|
+
class BunnyBehaviorTest < Minitest::Test
|
4
|
+
test "publishing fixnums and hashes works in amqp headers" do
|
5
|
+
client = Beetle::Client.new
|
6
|
+
client.register_queue(:test)
|
7
|
+
client.register_message(:test)
|
8
|
+
|
9
|
+
# purge the test queue
|
10
|
+
client.purge(:test)
|
11
|
+
|
12
|
+
# empty the dedup store
|
13
|
+
client.deduplication_store.flushdb
|
14
|
+
|
15
|
+
# register our handler to the message, check out the message.rb for more stuff you can get from the message object
|
16
|
+
message = nil
|
17
|
+
client.register_handler(:test) {|msg| message = msg; client.stop_listening }
|
18
|
+
|
19
|
+
# publish our message (NOTE: empty message bodies don't work, most likely due to bugs in bunny/amqp)
|
20
|
+
published = client.publish(:test, 'bam', headers: { foo: 1, table: {bar: "baz"}})
|
21
|
+
|
22
|
+
# start listening
|
23
|
+
client.listen
|
24
|
+
client.stop_publishing
|
25
|
+
|
26
|
+
assert_equal 1, published
|
27
|
+
assert_equal "bam", message.data
|
28
|
+
headers = message.header.attributes[:headers]
|
29
|
+
assert_equal 1, headers["foo"]
|
30
|
+
assert_equal({"bar" => "baz"}, headers["table"])
|
31
|
+
end
|
32
|
+
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.6
|
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:
|
15
|
+
date: 2023-03-23 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: bunny
|
@@ -407,6 +407,7 @@ files:
|
|
407
407
|
- test/beetle/amqp_gem_behavior_test.rb
|
408
408
|
- test/beetle/base_test.rb
|
409
409
|
- test/beetle/beetle_test.rb
|
410
|
+
- test/beetle/bunny_behavior_test.rb
|
410
411
|
- test/beetle/client_test.rb
|
411
412
|
- test/beetle/configuration_test.rb
|
412
413
|
- test/beetle/deduplication_store_test.rb
|
@@ -440,7 +441,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
440
441
|
- !ruby/object:Gem::Version
|
441
442
|
version: 1.3.7
|
442
443
|
requirements: []
|
443
|
-
rubygems_version: 3.
|
444
|
+
rubygems_version: 3.4.6
|
444
445
|
signing_key:
|
445
446
|
specification_version: 3
|
446
447
|
summary: High Availability AMQP Messaging with Redundant Queues
|
@@ -448,6 +449,7 @@ test_files:
|
|
448
449
|
- test/beetle/amqp_gem_behavior_test.rb
|
449
450
|
- test/beetle/base_test.rb
|
450
451
|
- test/beetle/beetle_test.rb
|
452
|
+
- test/beetle/bunny_behavior_test.rb
|
451
453
|
- test/beetle/client_test.rb
|
452
454
|
- test/beetle/configuration_test.rb
|
453
455
|
- test/beetle/deduplication_store_test.rb
|