bunny 2.6.3 → 2.6.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -3
- data/ChangeLog.md +23 -2
- data/Gemfile +3 -3
- data/LICENSE +1 -1
- data/README.md +2 -2
- data/lib/bunny/channel.rb +1 -1
- data/lib/bunny/channel_id_allocator.rb +3 -3
- data/lib/bunny/concurrent/continuation_queue.rb +9 -5
- data/lib/bunny/exceptions.rb +6 -0
- data/lib/bunny/session.rb +69 -11
- data/lib/bunny/transport.rb +1 -1
- data/lib/bunny/version.rb +1 -1
- data/spec/higher_level_api/integration/basic_ack_spec.rb +46 -46
- data/spec/higher_level_api/integration/basic_cancel_spec.rb +13 -13
- data/spec/higher_level_api/integration/basic_consume_spec.rb +40 -40
- data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +5 -5
- data/spec/higher_level_api/integration/basic_get_spec.rb +5 -5
- data/spec/higher_level_api/integration/basic_nack_spec.rb +13 -13
- data/spec/higher_level_api/integration/basic_publish_spec.rb +7 -7
- data/spec/higher_level_api/integration/basic_qos_spec.rb +1 -1
- data/spec/higher_level_api/integration/basic_reject_spec.rb +23 -23
- data/spec/higher_level_api/integration/basic_return_spec.rb +3 -3
- data/spec/higher_level_api/integration/channel_close_spec.rb +1 -1
- data/spec/higher_level_api/integration/channel_open_spec.rb +1 -1
- data/spec/higher_level_api/integration/connection_recovery_spec.rb +93 -55
- data/spec/higher_level_api/integration/connection_spec.rb +46 -46
- data/spec/higher_level_api/integration/connection_stop_spec.rb +9 -8
- data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +14 -14
- data/spec/higher_level_api/integration/dead_lettering_spec.rb +8 -8
- data/spec/higher_level_api/integration/exchange_bind_spec.rb +4 -4
- data/spec/higher_level_api/integration/exchange_declare_spec.rb +10 -10
- data/spec/higher_level_api/integration/exchange_delete_spec.rb +1 -1
- data/spec/higher_level_api/integration/exchange_unbind_spec.rb +3 -3
- data/spec/higher_level_api/integration/exclusive_queue_spec.rb +5 -5
- data/spec/higher_level_api/integration/heartbeat_spec.rb +4 -4
- data/spec/higher_level_api/integration/merry_go_round_spec.rb +10 -10
- data/spec/higher_level_api/integration/message_properties_access_spec.rb +22 -22
- data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +1 -1
- data/spec/higher_level_api/integration/publisher_confirms_spec.rb +8 -8
- data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +10 -10
- data/spec/higher_level_api/integration/queue_bind_spec.rb +10 -10
- data/spec/higher_level_api/integration/queue_declare_spec.rb +14 -11
- data/spec/higher_level_api/integration/queue_delete_spec.rb +1 -1
- data/spec/higher_level_api/integration/queue_purge_spec.rb +3 -3
- data/spec/higher_level_api/integration/queue_unbind_spec.rb +4 -4
- data/spec/higher_level_api/integration/read_only_consumer_spec.rb +7 -7
- data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +6 -6
- data/spec/higher_level_api/integration/tls_connection_spec.rb +40 -40
- 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 +1 -1
- data/spec/issues/issue100_spec.rb +7 -7
- data/spec/issues/issue141_spec.rb +3 -3
- data/spec/issues/issue224_spec.rb +3 -3
- data/spec/issues/issue465_spec.rb +32 -0
- data/spec/issues/issue78_spec.rb +11 -10
- data/spec/issues/issue83_spec.rb +1 -1
- data/spec/issues/issue97_spec.rb +20 -20
- data/spec/stress/channel_close_stress_spec.rb +3 -3
- data/spec/stress/channel_open_stress_spec.rb +3 -3
- data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +2 -1
- data/spec/stress/concurrent_consumers_stress_spec.rb +6 -6
- data/spec/stress/concurrent_publishers_stress_spec.rb +2 -1
- data/spec/stress/connection_open_close_spec.rb +3 -3
- data/spec/stress/long_running_consumer_spec.rb +7 -5
- data/spec/unit/concurrent/condition_spec.rb +5 -5
- metadata +4 -6
- data/spec/higher_level_api/integration/basic_recover_spec.rb +0 -18
- data/spec/higher_level_api/integration/consistent_hash_exchange_spec.rb +0 -59
@@ -2,14 +2,14 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe "A client-named", Bunny::Queue do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
9
9
|
|
10
10
|
it "can be bound to a pre-declared exchange" do
|
11
11
|
ch = connection.create_channel
|
12
|
-
q = ch.queue("bunny.tests.queues.client-named#{rand}", :
|
12
|
+
q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
|
13
13
|
expect(q).not_to be_server_named
|
14
14
|
|
15
15
|
expect(q.bind("amq.fanout")).to eq q
|
@@ -19,7 +19,7 @@ describe "A client-named", Bunny::Queue do
|
|
19
19
|
|
20
20
|
it "can be unbound from a pre-declared exchange" do
|
21
21
|
ch = connection.create_channel
|
22
|
-
q = ch.queue("bunny.tests.queues.client-named#{rand}", :
|
22
|
+
q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
|
23
23
|
expect(q).not_to be_server_named
|
24
24
|
|
25
25
|
q.bind("amq.fanout")
|
@@ -30,7 +30,7 @@ describe "A client-named", Bunny::Queue do
|
|
30
30
|
|
31
31
|
it "can be bound to a custom exchange" do
|
32
32
|
ch = connection.create_channel
|
33
|
-
q = ch.queue("bunny.tests.queues.client-named#{rand}", :
|
33
|
+
q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
|
34
34
|
|
35
35
|
x = ch.fanout("bunny.tests.exchanges.fanout#{rand}")
|
36
36
|
expect(q.bind(x)).to eq q
|
@@ -41,10 +41,10 @@ describe "A client-named", Bunny::Queue do
|
|
41
41
|
|
42
42
|
it "can be unbound from a custom exchange" do
|
43
43
|
ch = connection.create_channel
|
44
|
-
q = ch.queue("bunny.tests.queues.client-named#{rand}", :
|
44
|
+
q = ch.queue("bunny.tests.queues.client-named#{rand}", exclusive: true)
|
45
45
|
expect(q).not_to be_server_named
|
46
46
|
|
47
|
-
x = ch.fanout("bunny.tests.fanout", :
|
47
|
+
x = ch.fanout("bunny.tests.fanout", auto_delete: true, durable: false)
|
48
48
|
|
49
49
|
q.bind(x)
|
50
50
|
expect(q.unbind(x)).to eq q
|
@@ -64,7 +64,7 @@ describe "A server-named", Bunny::Queue do
|
|
64
64
|
|
65
65
|
it "can be bound to a pre-declared exchange" do
|
66
66
|
ch = connection.create_channel
|
67
|
-
q = ch.queue("", :
|
67
|
+
q = ch.queue("", exclusive: true)
|
68
68
|
expect(q).to be_server_named
|
69
69
|
|
70
70
|
expect(q.bind("amq.fanout")).to eq q
|
@@ -74,7 +74,7 @@ describe "A server-named", Bunny::Queue do
|
|
74
74
|
|
75
75
|
it "can be unbound from a pre-declared exchange" do
|
76
76
|
ch = connection.create_channel
|
77
|
-
q = ch.queue("", :
|
77
|
+
q = ch.queue("", exclusive: true)
|
78
78
|
expect(q).to be_server_named
|
79
79
|
|
80
80
|
q.bind("amq.fanout")
|
@@ -85,7 +85,7 @@ describe "A server-named", Bunny::Queue do
|
|
85
85
|
|
86
86
|
it "can be bound to a custom exchange" do
|
87
87
|
ch = connection.create_channel
|
88
|
-
q = ch.queue("", :
|
88
|
+
q = ch.queue("", exclusive: true)
|
89
89
|
|
90
90
|
x = ch.fanout("bunny.tests.exchanges.fanout#{rand}")
|
91
91
|
expect(q.bind(x)).to eq q
|
@@ -96,7 +96,7 @@ describe "A server-named", Bunny::Queue do
|
|
96
96
|
|
97
97
|
it "can be bound from a custom exchange" do
|
98
98
|
ch = connection.create_channel
|
99
|
-
q = ch.queue("", :
|
99
|
+
q = ch.queue("", exclusive: true)
|
100
100
|
|
101
101
|
name = "bunny.tests.exchanges.fanout#{rand}"
|
102
102
|
x = ch.fanout(name)
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Queue do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(user: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
@@ -55,7 +55,7 @@ describe Bunny::Queue do
|
|
55
55
|
it "declares it as durable" do
|
56
56
|
ch = connection.create_channel
|
57
57
|
|
58
|
-
q = ch.queue("bunny.tests.queues.durable", :
|
58
|
+
q = ch.queue("bunny.tests.queues.durable", durable: true)
|
59
59
|
expect(q).to be_durable
|
60
60
|
expect(q).not_to be_auto_delete
|
61
61
|
expect(q).not_to be_exclusive
|
@@ -71,7 +71,7 @@ describe Bunny::Queue do
|
|
71
71
|
it "declares it as exclusive" do
|
72
72
|
ch = connection.create_channel
|
73
73
|
|
74
|
-
q = ch.queue("bunny.tests.queues.exclusive", :
|
74
|
+
q = ch.queue("bunny.tests.queues.exclusive", exclusive: true)
|
75
75
|
expect(q).to be_exclusive
|
76
76
|
expect(q).not_to be_durable
|
77
77
|
q.delete
|
@@ -85,7 +85,7 @@ describe Bunny::Queue do
|
|
85
85
|
it "declares it as auto-delete" do
|
86
86
|
ch = connection.create_channel
|
87
87
|
|
88
|
-
q = ch.queue("bunny.tests.queues.auto-delete", :
|
88
|
+
q = ch.queue("bunny.tests.queues.auto-delete", auto_delete: true)
|
89
89
|
expect(q).to be_auto_delete
|
90
90
|
expect(q).not_to be_exclusive
|
91
91
|
expect(q).not_to be_durable
|
@@ -101,10 +101,10 @@ describe Bunny::Queue do
|
|
101
101
|
it "raises an exception" do
|
102
102
|
ch = connection.create_channel
|
103
103
|
|
104
|
-
q = ch.queue("bunny.tests.queues.auto-delete", :
|
104
|
+
q = ch.queue("bunny.tests.queues.auto-delete", auto_delete: true, durable: false)
|
105
105
|
expect {
|
106
106
|
# force re-declaration
|
107
|
-
ch.queue_declare("bunny.tests.queues.auto-delete", :
|
107
|
+
ch.queue_declare("bunny.tests.queues.auto-delete", auto_delete: false, durable: true)
|
108
108
|
}.to raise_error(Bunny::PreconditionFailed)
|
109
109
|
|
110
110
|
expect(ch).to be_closed
|
@@ -121,7 +121,7 @@ describe Bunny::Queue do
|
|
121
121
|
it "causes all messages in it to have a TTL" do
|
122
122
|
ch = connection.create_channel
|
123
123
|
|
124
|
-
q = ch.queue("bunny.tests.queues.with-arguments.ttl", :
|
124
|
+
q = ch.queue("bunny.tests.queues.with-arguments.ttl", arguments: args, exclusive: true)
|
125
125
|
expect(q.arguments).to eq args
|
126
126
|
|
127
127
|
q.publish("xyzzy")
|
@@ -142,10 +142,13 @@ describe Bunny::Queue do
|
|
142
142
|
end
|
143
143
|
|
144
144
|
it "enables priority implementation" do
|
145
|
-
|
145
|
+
c = Bunny.new(user: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
146
|
+
c.start
|
147
|
+
|
148
|
+
ch = c.create_channel
|
146
149
|
ch.confirm_select
|
147
150
|
|
148
|
-
q = ch.queue("bunny.tests.queues.with-arguments.priority", :
|
151
|
+
q = ch.queue("bunny.tests.queues.with-arguments.priority #{rand}", arguments: args, exclusive: true)
|
149
152
|
expect(q.arguments).to eq args
|
150
153
|
|
151
154
|
q.publish("xyzzy")
|
@@ -168,7 +171,7 @@ describe Bunny::Queue do
|
|
168
171
|
context "when a queue exists" do
|
169
172
|
it "returns true" do
|
170
173
|
ch = connection.create_channel
|
171
|
-
q = ch.queue("", :
|
174
|
+
q = ch.queue("", exlusive: true)
|
172
175
|
|
173
176
|
expect(connection.queue_exists?(q.name)).to eq true
|
174
177
|
end
|
@@ -196,7 +199,7 @@ describe Bunny::Queue do
|
|
196
199
|
it "causes the queue to be bounded" do
|
197
200
|
ch = connection.create_channel
|
198
201
|
|
199
|
-
q = ch.queue("bunny.tests.queues.with-arguments.max-length", :
|
202
|
+
q = ch.queue("bunny.tests.queues.with-arguments.max-length", arguments: args, exclusive: true)
|
200
203
|
expect(q.arguments).to eq args
|
201
204
|
|
202
205
|
(n * 10).times do
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Queue, "#delete" do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Queue do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
@@ -15,10 +15,10 @@ describe Bunny::Queue do
|
|
15
15
|
it "can be purged" do
|
16
16
|
ch = connection.create_channel
|
17
17
|
|
18
|
-
q = ch.queue("", :
|
18
|
+
q = ch.queue("", exclusive: true)
|
19
19
|
x = ch.default_exchange
|
20
20
|
|
21
|
-
x.publish("xyzzy", :
|
21
|
+
x.publish("xyzzy", routing_key: q.name)
|
22
22
|
sleep(0.5)
|
23
23
|
|
24
24
|
expect(q.message_count).to eq 1
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Queue, "bound to an exchange" do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
@@ -15,7 +15,7 @@ describe Bunny::Queue, "bound to an exchange" do
|
|
15
15
|
it "can be unbound from an exchange it was bound to" do
|
16
16
|
ch = connection.create_channel
|
17
17
|
x = ch.fanout("amq.fanout")
|
18
|
-
q = ch.queue("", :
|
18
|
+
q = ch.queue("", exclusive: true).bind(x)
|
19
19
|
|
20
20
|
x.publish("")
|
21
21
|
sleep 0.3
|
@@ -32,7 +32,7 @@ end
|
|
32
32
|
|
33
33
|
describe Bunny::Queue, "NOT bound to an exchange" do
|
34
34
|
let(:connection) do
|
35
|
-
c = Bunny.new(:
|
35
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
36
36
|
c.start
|
37
37
|
c
|
38
38
|
end
|
@@ -45,7 +45,7 @@ describe Bunny::Queue, "NOT bound to an exchange" do
|
|
45
45
|
it "is idempotent (succeeds)" do
|
46
46
|
ch = connection.create_channel
|
47
47
|
x = ch.fanout("amq.fanout")
|
48
|
-
q = ch.queue("", :
|
48
|
+
q = ch.queue("", exclusive: true)
|
49
49
|
|
50
50
|
# No exception as of RabbitMQ 3.2. MK.
|
51
51
|
q.unbind(x)
|
@@ -2,13 +2,13 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Queue, "#subscribe" do
|
4
4
|
let(:publisher_connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
9
9
|
|
10
10
|
let(:consumer_connection) do
|
11
|
-
c = Bunny.new(:
|
11
|
+
c = Bunny.new(username: "bunny_reader", password: "reader_password", vhost: "bunny_testbed")
|
12
12
|
c.start
|
13
13
|
c
|
14
14
|
end
|
@@ -28,7 +28,7 @@ describe Bunny::Queue, "#subscribe" do
|
|
28
28
|
ch = publisher_connection.create_channel
|
29
29
|
# declare the queue because the read-only user won't be able to issue
|
30
30
|
# queue.declare
|
31
|
-
q = ch.queue(queue_name, :
|
31
|
+
q = ch.queue(queue_name, auto_delete: true, durable: false)
|
32
32
|
|
33
33
|
t = Thread.new do
|
34
34
|
# give the main thread a bit of time to declare the queue
|
@@ -36,8 +36,8 @@ describe Bunny::Queue, "#subscribe" do
|
|
36
36
|
ch = consumer_connection.create_channel
|
37
37
|
# this connection is read only, use passive declare to only get
|
38
38
|
# a reference to the queue
|
39
|
-
q = ch.queue(queue_name, :
|
40
|
-
q.subscribe(:
|
39
|
+
q = ch.queue(queue_name, auto_delete: true, durable: false, passive: true)
|
40
|
+
q.subscribe(exclusive: false) do |delivery_info, properties, payload|
|
41
41
|
delivered_keys << delivery_info.routing_key
|
42
42
|
delivered_data << payload
|
43
43
|
end
|
@@ -46,13 +46,13 @@ describe Bunny::Queue, "#subscribe" do
|
|
46
46
|
sleep 0.5
|
47
47
|
|
48
48
|
x = ch.default_exchange
|
49
|
-
x.publish("hello", :
|
49
|
+
x.publish("hello", routing_key: queue_name)
|
50
50
|
|
51
51
|
sleep 0.7
|
52
52
|
expect(delivered_keys).to include(queue_name)
|
53
53
|
expect(delivered_data).to include("hello")
|
54
54
|
|
55
|
-
expect(ch.queue(queue_name, :
|
55
|
+
expect(ch.queue(queue_name, auto_delete: true, durable: false).message_count).to eq 0
|
56
56
|
|
57
57
|
ch.close
|
58
58
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe "Sender-selected distribution" do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|
@@ -14,14 +14,14 @@ describe "Sender-selected distribution" do
|
|
14
14
|
it "lets publishers specify additional routing keys using CC and BCC headers" do
|
15
15
|
ch = connection.create_channel
|
16
16
|
x = ch.direct("bunny.tests.ssd.exchange")
|
17
|
-
q1 = ch.queue("", :
|
18
|
-
q2 = ch.queue("", :
|
19
|
-
q3 = ch.queue("", :
|
20
|
-
q4 = ch.queue("", :
|
17
|
+
q1 = ch.queue("", exclusive: true).bind(x, routing_key: "one")
|
18
|
+
q2 = ch.queue("", exclusive: true).bind(x, routing_key: "two")
|
19
|
+
q3 = ch.queue("", exclusive: true).bind(x, routing_key: "three")
|
20
|
+
q4 = ch.queue("", exclusive: true).bind(x, routing_key: "four")
|
21
21
|
|
22
22
|
n = 10
|
23
23
|
n.times do |i|
|
24
|
-
x.publish("Message #{i}", :
|
24
|
+
x.publish("Message #{i}", routing_key: "one", headers: {"CC" => ["two", "three"]})
|
25
25
|
end
|
26
26
|
|
27
27
|
sleep 0.5
|
@@ -7,13 +7,13 @@ unless ENV["CI"]
|
|
7
7
|
expect(connection).to be_tls
|
8
8
|
ch = connection.create_channel
|
9
9
|
|
10
|
-
q = ch.queue("", :
|
10
|
+
q = ch.queue("", exclusive: true)
|
11
11
|
x = ch.default_exchange
|
12
12
|
|
13
|
-
x.publish("xyzzy", :
|
14
|
-
publish("xyzzy", :
|
15
|
-
publish("xyzzy", :
|
16
|
-
publish("xyzzy", :
|
13
|
+
x.publish("xyzzy", routing_key: q.name).
|
14
|
+
publish("xyzzy", routing_key: q.name).
|
15
|
+
publish("xyzzy", routing_key: q.name).
|
16
|
+
publish("xyzzy", routing_key: q.name)
|
17
17
|
|
18
18
|
sleep 0.5
|
19
19
|
expect(q.message_count).to eq 4
|
@@ -33,14 +33,14 @@ unless ENV["CI"]
|
|
33
33
|
|
34
34
|
describe "TLS connection to RabbitMQ with client certificates" do
|
35
35
|
let(:connection) do
|
36
|
-
c = Bunny.new(:
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
36
|
+
c = Bunny.new(username: "bunny_gem",
|
37
|
+
password: "bunny_password",
|
38
|
+
vhost: "bunny_testbed",
|
39
|
+
tls: true,
|
40
|
+
tls_cert: "spec/tls/client_certificate.pem",
|
41
|
+
tls_key: "spec/tls/client_key.pem",
|
42
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
43
|
+
verify_peer: false)
|
44
44
|
c.start
|
45
45
|
c
|
46
46
|
end
|
@@ -55,12 +55,12 @@ unless ENV["CI"]
|
|
55
55
|
|
56
56
|
describe "TLS connection to RabbitMQ without client certificates" do
|
57
57
|
let(:connection) do
|
58
|
-
c = Bunny.new(:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
58
|
+
c = Bunny.new(username: "bunny_gem",
|
59
|
+
password: "bunny_password",
|
60
|
+
vhost: "bunny_testbed",
|
61
|
+
tls: true,
|
62
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
63
|
+
verify_peer: false)
|
64
64
|
c.start
|
65
65
|
c
|
66
66
|
end
|
@@ -76,10 +76,10 @@ unless ENV["CI"]
|
|
76
76
|
describe "TLS connection to RabbitMQ with a connection string" do
|
77
77
|
let(:connection) do
|
78
78
|
c = Bunny.new("amqps://bunny_gem:bunny_password@127.0.0.1/bunny_testbed",
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
79
|
+
tls_cert: "spec/tls/client_certificate.pem",
|
80
|
+
tls_key: "spec/tls/client_key.pem",
|
81
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
82
|
+
verify_peer: false)
|
83
83
|
c.start
|
84
84
|
c
|
85
85
|
end
|
@@ -95,8 +95,8 @@ unless ENV["CI"]
|
|
95
95
|
describe "TLS connection to RabbitMQ with a connection string and w/o client certificate and key" do
|
96
96
|
let(:connection) do
|
97
97
|
c = Bunny.new("amqps://bunny_gem:bunny_password@127.0.0.1/bunny_testbed",
|
98
|
-
:
|
99
|
-
:
|
98
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
99
|
+
verify_peer: false)
|
100
100
|
c.start
|
101
101
|
c
|
102
102
|
end
|
@@ -111,14 +111,14 @@ unless ENV["CI"]
|
|
111
111
|
|
112
112
|
describe "TLS connection to RabbitMQ with client certificates provided inline" do
|
113
113
|
let(:connection) do
|
114
|
-
c = Bunny.new(:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
114
|
+
c = Bunny.new(username: "bunny_gem",
|
115
|
+
password: "bunny_password",
|
116
|
+
vhost: "bunny_testbed",
|
117
|
+
tls: true,
|
118
|
+
tls_cert: File.read("./spec/tls/client_certificate.pem"),
|
119
|
+
tls_key: File.read("./spec/tls/client_key.pem"),
|
120
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
121
|
+
verify_peer: false)
|
122
122
|
c.start
|
123
123
|
c
|
124
124
|
end
|
@@ -132,13 +132,13 @@ unless ENV["CI"]
|
|
132
132
|
|
133
133
|
describe "TLS connection to RabbitMQ with tls_version TLSv1 specified" do
|
134
134
|
let(:connection) do
|
135
|
-
c = Bunny.new(:
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
135
|
+
c = Bunny.new(username: "bunny_gem",
|
136
|
+
password: "bunny_password",
|
137
|
+
vhost: "bunny_testbed",
|
138
|
+
tls: true,
|
139
|
+
tls_protocol: :TLSv1,
|
140
|
+
tls_ca_certificates: ["./spec/tls/ca_certificate.pem"],
|
141
|
+
verify_peer: false)
|
142
142
|
c.start
|
143
143
|
c
|
144
144
|
end
|
@@ -2,7 +2,7 @@ require "spec_helper"
|
|
2
2
|
|
3
3
|
describe Bunny::Channel, "#tx_commit" do
|
4
4
|
let(:connection) do
|
5
|
-
c = Bunny.new(:
|
5
|
+
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
7
7
|
c
|
8
8
|
end
|