bunny 1.3.0 → 2.17.0
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.
- checksums.yaml +5 -5
- data/.github/ISSUE_TEMPLATE.md +18 -0
- data/.gitignore +7 -1
- data/.rspec +1 -3
- data/.travis.yml +21 -14
- data/CONTRIBUTING.md +132 -0
- data/ChangeLog.md +887 -1
- data/Gemfile +13 -13
- data/LICENSE +1 -1
- data/README.md +46 -60
- data/Rakefile +54 -0
- data/bunny.gemspec +5 -11
- data/docker-compose.yml +28 -0
- data/docker/Dockerfile +24 -0
- data/docker/apt/preferences.d/erlang +3 -0
- data/docker/apt/sources.list.d/bintray.rabbitmq.list +2 -0
- data/docker/docker-entrypoint.sh +26 -0
- data/docker/rabbitmq.conf +29 -0
- data/examples/connection/automatic_recovery_with_basic_get.rb +1 -1
- data/examples/connection/automatic_recovery_with_client_named_queues.rb +1 -1
- data/examples/connection/automatic_recovery_with_multiple_consumers.rb +1 -1
- data/examples/connection/automatic_recovery_with_republishing.rb +1 -1
- data/examples/connection/automatic_recovery_with_server_named_queues.rb +1 -1
- data/examples/connection/channel_level_exception.rb +1 -9
- data/examples/connection/disabled_automatic_recovery.rb +1 -1
- data/examples/connection/heartbeat.rb +1 -1
- data/examples/consumers/high_and_low_priority.rb +1 -1
- data/examples/guides/extensions/alternate_exchange.rb +2 -0
- data/examples/guides/extensions/basic_nack.rb +1 -1
- data/examples/guides/extensions/dead_letter_exchange.rb +1 -1
- data/examples/guides/getting_started/hello_world.rb +2 -0
- data/examples/guides/getting_started/weathr.rb +2 -0
- data/examples/guides/queues/one_off_consumer.rb +2 -0
- data/examples/guides/queues/redeliveries.rb +4 -2
- data/lib/bunny.rb +8 -4
- data/lib/bunny/channel.rb +268 -153
- data/lib/bunny/channel_id_allocator.rb +6 -4
- data/lib/bunny/concurrent/continuation_queue.rb +34 -13
- data/lib/bunny/consumer_work_pool.rb +34 -6
- data/lib/bunny/cruby/socket.rb +48 -21
- data/lib/bunny/cruby/ssl_socket.rb +65 -4
- data/lib/bunny/exceptions.rb +25 -4
- data/lib/bunny/exchange.rb +24 -28
- data/lib/bunny/get_response.rb +1 -1
- data/lib/bunny/heartbeat_sender.rb +3 -2
- data/lib/bunny/jruby/socket.rb +23 -6
- data/lib/bunny/jruby/ssl_socket.rb +5 -0
- data/lib/bunny/queue.rb +31 -22
- data/lib/bunny/reader_loop.rb +31 -18
- data/lib/bunny/session.rb +448 -159
- data/lib/bunny/test_kit.rb +14 -0
- data/lib/bunny/timeout.rb +1 -12
- data/lib/bunny/transport.rb +205 -98
- data/lib/bunny/version.rb +1 -1
- data/repl +1 -1
- data/spec/config/enabled_plugins +1 -0
- data/spec/config/rabbitmq.conf +13 -0
- data/spec/higher_level_api/integration/basic_ack_spec.rb +175 -16
- data/spec/higher_level_api/integration/basic_cancel_spec.rb +77 -11
- data/spec/higher_level_api/integration/basic_consume_spec.rb +60 -55
- data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +6 -6
- data/spec/higher_level_api/integration/basic_get_spec.rb +31 -7
- data/spec/higher_level_api/integration/basic_nack_spec.rb +22 -19
- data/spec/higher_level_api/integration/basic_publish_spec.rb +11 -100
- data/spec/higher_level_api/integration/basic_qos_spec.rb +32 -4
- data/spec/higher_level_api/integration/basic_reject_spec.rb +94 -16
- data/spec/higher_level_api/integration/basic_return_spec.rb +4 -4
- data/spec/higher_level_api/integration/channel_close_spec.rb +51 -10
- data/spec/higher_level_api/integration/channel_open_spec.rb +12 -12
- data/spec/higher_level_api/integration/connection_recovery_spec.rb +424 -221
- data/spec/higher_level_api/integration/connection_spec.rb +300 -126
- data/spec/higher_level_api/integration/connection_stop_spec.rb +31 -19
- data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +17 -17
- data/spec/higher_level_api/integration/dead_lettering_spec.rb +34 -11
- data/spec/higher_level_api/integration/exchange_bind_spec.rb +5 -5
- data/spec/higher_level_api/integration/exchange_declare_spec.rb +32 -31
- data/spec/higher_level_api/integration/exchange_delete_spec.rb +12 -12
- data/spec/higher_level_api/integration/exchange_unbind_spec.rb +5 -5
- data/spec/higher_level_api/integration/exclusive_queue_spec.rb +5 -5
- data/spec/higher_level_api/integration/heartbeat_spec.rb +26 -8
- data/spec/higher_level_api/integration/message_properties_access_spec.rb +49 -49
- data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +2 -2
- data/spec/higher_level_api/integration/publisher_confirms_spec.rb +156 -42
- data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +19 -19
- data/spec/higher_level_api/integration/queue_bind_spec.rb +23 -23
- data/spec/higher_level_api/integration/queue_declare_spec.rb +129 -34
- data/spec/higher_level_api/integration/queue_delete_spec.rb +2 -2
- data/spec/higher_level_api/integration/queue_purge_spec.rb +5 -5
- data/spec/higher_level_api/integration/queue_unbind_spec.rb +6 -6
- data/spec/higher_level_api/integration/read_only_consumer_spec.rb +9 -9
- data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +10 -10
- data/spec/higher_level_api/integration/tls_connection_spec.rb +224 -89
- data/spec/higher_level_api/integration/toxiproxy_spec.rb +76 -0
- data/spec/higher_level_api/integration/tx_commit_spec.rb +1 -1
- data/spec/higher_level_api/integration/tx_rollback_spec.rb +1 -1
- data/spec/higher_level_api/integration/with_channel_spec.rb +2 -2
- data/spec/issues/issue100_spec.rb +11 -11
- data/spec/issues/issue141_spec.rb +13 -14
- data/spec/issues/issue202_spec.rb +1 -1
- data/spec/issues/issue224_spec.rb +40 -0
- data/spec/issues/issue465_spec.rb +32 -0
- data/spec/issues/issue549_spec.rb +30 -0
- data/spec/issues/issue78_spec.rb +21 -24
- data/spec/issues/issue83_spec.rb +5 -6
- data/spec/issues/issue97_spec.rb +44 -45
- data/spec/lower_level_api/integration/basic_cancel_spec.rb +15 -16
- data/spec/lower_level_api/integration/basic_consume_spec.rb +20 -21
- data/spec/spec_helper.rb +8 -26
- data/spec/stress/channel_close_stress_spec.rb +64 -0
- data/spec/stress/channel_open_stress_spec.rb +15 -9
- data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +7 -7
- data/spec/stress/concurrent_consumers_stress_spec.rb +18 -16
- data/spec/stress/concurrent_publishers_stress_spec.rb +16 -19
- data/spec/stress/connection_open_close_spec.rb +9 -9
- data/spec/stress/merry_go_round_spec.rb +105 -0
- data/spec/tls/client_key.pem +49 -25
- data/spec/tls/generate-server-cert.sh +8 -0
- data/spec/tls/server-openssl.cnf +10 -0
- data/spec/tls/server.csr +16 -0
- data/spec/tls/server_key.pem +49 -25
- data/spec/toxiproxy_helper.rb +28 -0
- data/spec/unit/bunny_spec.rb +5 -5
- data/spec/unit/concurrent/atomic_fixnum_spec.rb +6 -6
- data/spec/unit/concurrent/condition_spec.rb +8 -8
- data/spec/unit/concurrent/linked_continuation_queue_spec.rb +2 -2
- data/spec/unit/concurrent/synchronized_sorted_set_spec.rb +16 -16
- data/spec/unit/exchange_recovery_spec.rb +39 -0
- data/spec/unit/version_delivery_tag_spec.rb +3 -3
- metadata +65 -47
- data/.ruby-version +0 -1
- data/lib/bunny/compatibility.rb +0 -24
- data/lib/bunny/system_timer.rb +0 -20
- data/spec/compatibility/queue_declare_spec.rb +0 -44
- data/spec/compatibility/queue_declare_with_default_channel_spec.rb +0 -33
- data/spec/higher_level_api/integration/basic_recover_spec.rb +0 -18
- data/spec/higher_level_api/integration/confirm_select_spec.rb +0 -19
- data/spec/higher_level_api/integration/consistent_hash_exchange_spec.rb +0 -50
- data/spec/higher_level_api/integration/merry_go_round_spec.rb +0 -85
- data/spec/stress/long_running_consumer_spec.rb +0 -83
- data/spec/tls/cacert.pem +0 -18
- data/spec/tls/client_cert.pem +0 -18
- data/spec/tls/server_cert.pem +0 -18
- data/spec/unit/system_timer_spec.rb +0 -10
data/.ruby-version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
2.0@rabbitmq
|
data/lib/bunny/compatibility.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Bunny
|
2
|
-
# Helper methods necessary to stay mostly backwards-compatible with legacy (0.7.x, 0.8.x) Bunny
|
3
|
-
# releases that hide channels completely from the API.
|
4
|
-
#
|
5
|
-
# @private
|
6
|
-
module Compatibility
|
7
|
-
|
8
|
-
#
|
9
|
-
# API
|
10
|
-
#
|
11
|
-
|
12
|
-
# @private
|
13
|
-
def channel_from(channel_or_connection)
|
14
|
-
# Bunny 0.8.x and earlier completely hide channels from the API. So, queues and exchanges are
|
15
|
-
# instantiated with a "Bunny object", which is a session. This function coerces two types of input to a
|
16
|
-
# channel.
|
17
|
-
if channel_or_connection.is_a?(Bunny::Session)
|
18
|
-
channel_or_connection.default_channel
|
19
|
-
else
|
20
|
-
channel_or_connection
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
data/lib/bunny/system_timer.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8; mode: ruby -*-
|
2
|
-
|
3
|
-
require "system_timer"
|
4
|
-
|
5
|
-
module Bunny
|
6
|
-
# Used for Ruby before 1.9
|
7
|
-
class SystemTimer
|
8
|
-
# Executes a block of code, raising if the execution does not finish
|
9
|
-
# in the alloted period of time, in seconds.
|
10
|
-
def self.timeout(seconds, exception = nil)
|
11
|
-
if seconds
|
12
|
-
::SystemTimer.timeout_after(seconds, exception) do
|
13
|
-
yield
|
14
|
-
end
|
15
|
-
else
|
16
|
-
yield
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end # SystemTimer
|
20
|
-
end # Bunny
|
@@ -1,44 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny::Queue, "backwards compatibility API" do
|
4
|
-
let(:connection) do
|
5
|
-
c = Bunny.new
|
6
|
-
c.start
|
7
|
-
c
|
8
|
-
end
|
9
|
-
|
10
|
-
after :all do
|
11
|
-
connection.close if connection.open?
|
12
|
-
end
|
13
|
-
|
14
|
-
context "when queue name is specified" do
|
15
|
-
let(:name) { "a queue declared at #{Time.now.to_i}" }
|
16
|
-
|
17
|
-
it "declares a new queue with that name" do
|
18
|
-
q = Bunny::Queue.new(connection, name)
|
19
|
-
q.name.should == name
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
|
24
|
-
context "when queue name is passed on as an empty string" do
|
25
|
-
it "uses server-assigned queue name" do
|
26
|
-
q = Bunny::Queue.new(connection, "")
|
27
|
-
q.name.should_not be_empty
|
28
|
-
q.name.should =~ /^amq.gen.+/
|
29
|
-
q.should be_server_named
|
30
|
-
q.delete
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
context "when queue name is completely omitted" do
|
36
|
-
it "uses server-assigned queue name" do
|
37
|
-
q = Bunny::Queue.new(connection)
|
38
|
-
q.name.should_not be_empty
|
39
|
-
q.name.should =~ /^amq.gen.+/
|
40
|
-
q.should be_server_named
|
41
|
-
q.delete
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny::Session do
|
4
|
-
let(:connection) do
|
5
|
-
c = Bunny.new
|
6
|
-
c.start
|
7
|
-
c
|
8
|
-
end
|
9
|
-
|
10
|
-
after :all do
|
11
|
-
connection.close if connection.open?
|
12
|
-
end
|
13
|
-
|
14
|
-
it "proxies #queue to the pre-opened channel for backwards compatibility" do
|
15
|
-
q = connection.queue("", :exclusive => true)
|
16
|
-
q.name.should =~ /^amq.gen/
|
17
|
-
end
|
18
|
-
|
19
|
-
it "proxies #fanout to the pre-opened channel for backwards compatibility" do
|
20
|
-
x = connection.fanout("amq.fanout")
|
21
|
-
x.name.should == "amq.fanout"
|
22
|
-
end
|
23
|
-
|
24
|
-
it "proxies #topic to the pre-opened channel for backwards compatibility" do
|
25
|
-
x = connection.topic("amq.topic")
|
26
|
-
x.name.should == "amq.topic"
|
27
|
-
end
|
28
|
-
|
29
|
-
it "proxies #direct to the pre-opened channel for backwards compatibility" do
|
30
|
-
x = connection.topic("amq.direct")
|
31
|
-
x.name.should == "amq.direct"
|
32
|
-
end
|
33
|
-
end
|
@@ -1,18 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny::Channel, "#recover" do
|
4
|
-
let(:connection) do
|
5
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
6
|
-
c.start
|
7
|
-
c
|
8
|
-
end
|
9
|
-
|
10
|
-
subject do
|
11
|
-
connection.create_channel
|
12
|
-
end
|
13
|
-
|
14
|
-
it "is supported" do
|
15
|
-
subject.recover(true).should be_instance_of(AMQ::Protocol::Basic::RecoverOk)
|
16
|
-
subject.recover(true).should be_instance_of(AMQ::Protocol::Basic::RecoverOk)
|
17
|
-
end
|
18
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe Bunny::Channel, "#confirm_select" do
|
4
|
-
let(:connection) do
|
5
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
6
|
-
c.start
|
7
|
-
c
|
8
|
-
end
|
9
|
-
|
10
|
-
after :each do
|
11
|
-
connection.close if connection.open?
|
12
|
-
end
|
13
|
-
|
14
|
-
it "is supported" do
|
15
|
-
connection.with_channel do |ch|
|
16
|
-
ch.confirm_select
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
unless ENV["CI"]
|
5
|
-
describe "x-consistent-hash exchange" do
|
6
|
-
let(:connection) do
|
7
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
8
|
-
c.start
|
9
|
-
c
|
10
|
-
end
|
11
|
-
|
12
|
-
after :each do
|
13
|
-
connection.close
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:list) { Range.new(0, 6).to_a.map(&:to_s) }
|
17
|
-
|
18
|
-
let(:m) { 1500 }
|
19
|
-
|
20
|
-
it "distributes messages between queues bound with the same routing key" do
|
21
|
-
ch = connection.create_channel
|
22
|
-
body = "сообщение"
|
23
|
-
# requires the consistent hash exchange plugin,
|
24
|
-
# enable it with
|
25
|
-
#
|
26
|
-
# $ [sudo] rabbitmq-plugins enable rabbitmq_consistent_hash_exchange
|
27
|
-
x = ch.exchange("bunny.stress.concurrent.consumers", :type => "x-consistent-hash", :durable => true)
|
28
|
-
|
29
|
-
qs = []
|
30
|
-
|
31
|
-
q1 = ch.queue("", :exclusive => true).bind(x, :routing_key => "5")
|
32
|
-
q2 = ch.queue("", :exclusive => true).bind(x, :routing_key => "5")
|
33
|
-
|
34
|
-
sleep 1.0
|
35
|
-
|
36
|
-
5.times do |i|
|
37
|
-
m.times do
|
38
|
-
x.publish(body, :routing_key => list.sample)
|
39
|
-
end
|
40
|
-
puts "Published #{(i + 1) * m} tiny messages..."
|
41
|
-
end
|
42
|
-
|
43
|
-
sleep 2.0
|
44
|
-
q1.message_count.should be > 100
|
45
|
-
q2.message_count.should be > 100
|
46
|
-
|
47
|
-
ch.close
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
@@ -1,85 +0,0 @@
|
|
1
|
-
require "spec_helper"
|
2
|
-
|
3
|
-
describe "A message that is proxied by multiple intermediate consumers" do
|
4
|
-
let(:c1) do
|
5
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
6
|
-
c.start
|
7
|
-
c
|
8
|
-
end
|
9
|
-
|
10
|
-
let(:c2) do
|
11
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
12
|
-
c.start
|
13
|
-
c
|
14
|
-
end
|
15
|
-
|
16
|
-
let(:c3) do
|
17
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
18
|
-
c.start
|
19
|
-
c
|
20
|
-
end
|
21
|
-
|
22
|
-
let(:c4) do
|
23
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
24
|
-
c.start
|
25
|
-
c
|
26
|
-
end
|
27
|
-
|
28
|
-
let(:c5) do
|
29
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed")
|
30
|
-
c.start
|
31
|
-
c
|
32
|
-
end
|
33
|
-
|
34
|
-
after :each do
|
35
|
-
[c1, c2, c3, c4, c5].each do |c|
|
36
|
-
c.close if c.open?
|
37
|
-
end
|
38
|
-
end
|
39
|
-
|
40
|
-
# message flow is as follows:
|
41
|
-
#
|
42
|
-
# x => q4 => q3 => q2 => q1 => xs (results)
|
43
|
-
it "reaches its final destination" do
|
44
|
-
n = 10000
|
45
|
-
xs = []
|
46
|
-
|
47
|
-
ch1 = c1.create_channel
|
48
|
-
q1 = ch1.queue("", :exclusive => true)
|
49
|
-
q1.subscribe do |_, _, payload|
|
50
|
-
xs << payload
|
51
|
-
end
|
52
|
-
|
53
|
-
ch2 = c2.create_channel
|
54
|
-
q2 = ch2.queue("", :exclusive => true)
|
55
|
-
q2.subscribe do |_, _, payload|
|
56
|
-
q1.publish(payload)
|
57
|
-
end
|
58
|
-
|
59
|
-
ch3 = c3.create_channel
|
60
|
-
q3 = ch2.queue("", :exclusive => true)
|
61
|
-
q3.subscribe do |_, _, payload|
|
62
|
-
q2.publish(payload)
|
63
|
-
end
|
64
|
-
|
65
|
-
ch4 = c4.create_channel
|
66
|
-
q4 = ch2.queue("", :exclusive => true)
|
67
|
-
q4.subscribe do |_, _, payload|
|
68
|
-
q3.publish(payload)
|
69
|
-
end
|
70
|
-
|
71
|
-
ch5 = c5.create_channel
|
72
|
-
x = ch5.default_exchange
|
73
|
-
|
74
|
-
n.times do |i|
|
75
|
-
x.publish("msg #{i}", :routing_key => q4.name)
|
76
|
-
end
|
77
|
-
|
78
|
-
t = n / 1000 * 3.0
|
79
|
-
puts "About to sleep for #{t} seconds..."
|
80
|
-
sleep(t)
|
81
|
-
|
82
|
-
xs.size.should == n
|
83
|
-
xs.last.should == "msg #{n - 1}"
|
84
|
-
end
|
85
|
-
end
|
@@ -1,83 +0,0 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
2
|
-
require "spec_helper"
|
3
|
-
|
4
|
-
unless ENV["CI"]
|
5
|
-
require "bunny/concurrent/condition"
|
6
|
-
require "bunny/test_kit"
|
7
|
-
|
8
|
-
describe "Long running [relatively to heartbeat interval] consumer that never publishes" do
|
9
|
-
let(:connection) do
|
10
|
-
c = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :automatic_recovery => false, :heartbeat_interval => 6)
|
11
|
-
c.start
|
12
|
-
c
|
13
|
-
end
|
14
|
-
|
15
|
-
after :all do
|
16
|
-
connection.close
|
17
|
-
end
|
18
|
-
|
19
|
-
let(:target) { 512 * 1024 * 1024 }
|
20
|
-
let(:queue) { "bunny.stress.long_running_consumer.#{Time.now.to_i}" }
|
21
|
-
|
22
|
-
let(:rate) { 50 }
|
23
|
-
let(:s) { 4.0 }
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
it "does not skip heartbeats" do
|
28
|
-
finished = Bunny::Concurrent::Condition.new
|
29
|
-
|
30
|
-
ct = Thread.new do
|
31
|
-
t = 0
|
32
|
-
ch = connection.create_channel(nil, 6)
|
33
|
-
begin
|
34
|
-
q = ch.queue(queue, :exclusive => true)
|
35
|
-
|
36
|
-
q.bind("amq.fanout").subscribe do |_, _, payload|
|
37
|
-
t += payload.bytesize
|
38
|
-
|
39
|
-
if t >= target
|
40
|
-
puts "Hit the target, done with the test..."
|
41
|
-
|
42
|
-
finished.notify_all
|
43
|
-
else
|
44
|
-
puts "Consumed #{(t.to_f / target.to_f).round(3) * 100}% of data"
|
45
|
-
end
|
46
|
-
end
|
47
|
-
rescue Interrupt => e
|
48
|
-
ch.maybe_kill_consumer_work_pool!
|
49
|
-
ch.close
|
50
|
-
end
|
51
|
-
end
|
52
|
-
ct.abort_on_exception = true
|
53
|
-
|
54
|
-
pt = Thread.new do
|
55
|
-
t = 0
|
56
|
-
ch = connection.create_channel
|
57
|
-
begin
|
58
|
-
x = ch.fanout("amq.fanout")
|
59
|
-
|
60
|
-
loop do
|
61
|
-
break if t >= target
|
62
|
-
|
63
|
-
rate.times do |i|
|
64
|
-
msg = Bunny::TestKit.message_in_kb(96, 8192, i)
|
65
|
-
x.publish(msg)
|
66
|
-
t += msg.bytesize
|
67
|
-
end
|
68
|
-
|
69
|
-
sleep (s * rand)
|
70
|
-
end
|
71
|
-
rescue Interrupt => e
|
72
|
-
ch.close
|
73
|
-
end
|
74
|
-
end
|
75
|
-
pt.abort_on_exception = true
|
76
|
-
|
77
|
-
finished.wait
|
78
|
-
|
79
|
-
ct.raise Interrupt.new
|
80
|
-
pt.raise Interrupt.new
|
81
|
-
end
|
82
|
-
end
|
83
|
-
end
|
data/spec/tls/cacert.pem
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
-----BEGIN CERTIFICATE-----
|
2
|
-
MIIC5DCCAcygAwIBAgIJAMa8aNd9TfEZMA0GCSqGSIb3DQEBBQUAMCIxETAPBgNV
|
3
|
-
BAMTCE15VGVzdENBMQ0wCwYDVQQHEwQxODE1MB4XDTEzMDYwMjE1NTQwMFoXDTE0
|
4
|
-
MDYwMjE1NTQwMFowIjERMA8GA1UEAxMITXlUZXN0Q0ExDTALBgNVBAcTBDE4MTUw
|
5
|
-
ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDSLh8ZM0+1wVrr4J9KZLLt
|
6
|
-
VtGoKEhuTWYa+DvDbdUYaD/G06GfRqsM0eOKuJfoaMz3qY49j/bZXmuG64rGx5oq
|
7
|
-
Lp6VBwAw1R3Pmw3rD7XgiK0/7mVmnC4nwQAs9/uCKeAMPHfMDAG33aalxb3FzJfa
|
8
|
-
RUiSIY7y7Kt7nCVC53foTFxbt0EKm7wjey1S8P9XkCB8x+ZT5G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