bunny 2.14.4 → 2.15.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cf0bcb6bc92f6092788f0eeffed76f438be49f1341857a6e5a94254544cf44e3
4
- data.tar.gz: 317240a20f888087e959999b7cbe10d57fe423316032bc6fa6f2a6733e8dd50c
3
+ metadata.gz: 6abcaa979facd973a801a4433d3a6985e15e89aa84cc0078cc464af3be6c4542
4
+ data.tar.gz: d8bc430b598d1a267fe075028e9536efeeb008c72d9387daaaa30c79391d54d8
5
5
  SHA512:
6
- metadata.gz: d0c159c08871fdf203a322543489d9c563d45c855f407f9e069adc6f3f0d97f7b0fb8d7ac90a5280dfdc2cea81dbef53e0c2b217be2064373432d0ca0d889626
7
- data.tar.gz: 4d8a071b4d8494ad3976d842a705cf3d8323d8c14c61a0c147c309cc07ebc77bf6420243a597c68a3cde9b4b7a6cb5f17e25bab7972cf607f1d1d55b8bd88cdb
6
+ metadata.gz: 384472c28da9fabdf01a9e1c403c9009bf000cd8a3256cbffab531f7e5582425d15320255a966b89c5075f1fb1bc029deef21e1d5fd776de2d4f9714e8f1553f
7
+ data.tar.gz: 2ccbfbde0c9f0a2ff0202cb1160d569cbbdc94095e79d021d59a9e7949fd1579189fddcb61849125d4cfefce7ad0a733943f7d3a54097e7fb2ed83117f15ec1f
@@ -11,9 +11,10 @@ before_script:
11
11
  script: "bundle exec rake integration_without_recovery"
12
12
  rvm:
13
13
  - ruby-head
14
- - "2.6.3"
15
- - "2.5.5"
16
- - "2.4.5"
14
+ - "2.7.1"
15
+ - "2.6.6"
16
+ - "2.5.8"
17
+ - "2.4.10"
17
18
  - "2.3.8"
18
19
  notifications:
19
20
  email: michael@rabbitmq.com
@@ -22,8 +23,8 @@ services:
22
23
  branches:
23
24
  only:
24
25
  - master
25
- - 2.12.x-stable
26
- - 2.11.x-stable
26
+ - 2.14.x-stable
27
+ - 2.13.x-stable
27
28
  env:
28
29
  - CI=true
29
30
  matrix:
@@ -1,9 +1,4 @@
1
- ## Changes between Bunny 2.14.4 and 2.14.5 (in development)
2
-
3
- No changes.
4
-
5
-
6
- ## Changes between Bunny 2.14.3 and 2.14.4 (Feb 11th, 2020)
1
+ ## Changes between Bunny 2.14.0 and 2.15.0 (Apr 8th, 2020)
7
2
 
8
3
  ### More Defensive Thread Join Operations
9
4
 
@@ -21,20 +16,16 @@ GitHub issue: [#589](https://github.com/ruby-amqp/bunny/issues/589)
21
16
 
22
17
  Contributed by @fuegas.
23
18
 
19
+ ### Dependency Updates
24
20
 
25
- ## Changes between Bunny 2.14.2 and 2.14.3 (Sep 29th, 2019)
26
-
27
- ### OpenSSL Exceptions Trigger Recovery
28
-
29
- OpenSSL exceptions on a fully established connection will now kick off
30
- connection recovery.
31
-
32
- GitHub issue: [#583](https://github.com/ruby-amqp/bunny/issues/583)
21
+ `amq-protocol` dependency has been bumped to `2.3.1` to support `connection.update-secret`
22
+ protocol extension.
33
23
 
34
- Contributed by Carl Hörberg.
24
+ ### Gem Installation Fixed on Windows
35
25
 
26
+ `bin/ci`, a directory with symlinks, is no longer included into the gem.
36
27
 
37
- ## Changes between Bunny 2.14.1 and 2.14.2 (Apr 24th, 2019)
28
+ Contributed by Jack Xiaosong Xu.
38
29
 
39
30
  ### Lazy Peer Certificate Chain Information Logging
40
31
 
@@ -47,16 +38,6 @@ GitHub issue: [#578](https://github.com/ruby-amqp/bunny/pull/578)
47
38
  Contributed by Garrett Thornburg.
48
39
 
49
40
 
50
- ## Changes between Bunny 2.14.0 and 2.14.1 (Feb 26th, 2019)
51
-
52
- ### Gem Installation Fixed on Windows
53
-
54
- `bin/ci`, a directory with symlinks, is no longer included into the gem.
55
-
56
- Contributed by Jack Xiaosong Xu.
57
-
58
- GitHub issue: [#573](https://github.com/ruby-amqp/bunny/pull/574)
59
-
60
41
  ## Changes between Bunny 2.13.0 and 2.14.0 (Feb 20th, 2019)
61
42
 
62
43
  ### Improved Peer Verification Failure Logging
data/Gemfile CHANGED
@@ -33,8 +33,8 @@ group :development do
33
33
  end
34
34
 
35
35
  group :test do
36
- gem "rspec", "~> 3.8.0"
37
- gem "rabbitmq_http_api_client", "~> 1.11.0", require: "rabbitmq/http/client"
36
+ gem "rspec", "~> 3.9.0"
37
+ gem "rabbitmq_http_api_client", "~> 1.13.0", require: "rabbitmq/http/client"
38
38
  gem "toxiproxy", "~> 1.0.3"
39
39
  end
40
40
 
data/README.md CHANGED
@@ -71,10 +71,10 @@ a stable public API.
71
71
  Change logs per release series:
72
72
 
73
73
  * [master](https://github.com/ruby-amqp/bunny/blob/master/ChangeLog.md)
74
+ * [2.14.x](https://github.com/ruby-amqp/bunny/blob/2.13.x-stable/ChangeLog.md)
74
75
  * [2.13.x](https://github.com/ruby-amqp/bunny/blob/2.13.x-stable/ChangeLog.md)
75
76
  * [2.12.x](https://github.com/ruby-amqp/bunny/blob/2.12.x-stable/ChangeLog.md)
76
77
  * [2.11.x](https://github.com/ruby-amqp/bunny/blob/2.11.x-stable/ChangeLog.md)
77
- * [2.10.x](https://github.com/ruby-amqp/bunny/blob/2.10.x-stable/ChangeLog.md)
78
78
 
79
79
 
80
80
 
@@ -97,7 +97,7 @@ gem install bunny
97
97
  To use Bunny in a project managed with Bundler:
98
98
 
99
99
  ``` ruby
100
- gem "bunny", ">= 2.13.0"
100
+ gem "bunny", ">= 2.14.1"
101
101
  ```
102
102
 
103
103
 
@@ -8,8 +8,8 @@ Gem::Specification.new do |s|
8
8
  s.name = "bunny"
9
9
  s.version = Bunny::VERSION.dup
10
10
  s.homepage = "http://rubybunny.info"
11
- s.summary = "Easy to use Ruby client for RabbitMQ"
12
- s.description = "Easy to use, feature complete Ruby client for RabbitMQ"
11
+ s.summary = "Popular easy to use Ruby client for RabbitMQ"
12
+ s.description = "Easy to use, feature complete Ruby client for RabbitMQ 3.3 and later versions."
13
13
  s.license = "MIT"
14
14
  s.required_ruby_version = Gem::Requirement.new(">= 2.2")
15
15
 
@@ -21,10 +21,10 @@ Gem::Specification.new do |s|
21
21
  "Michael S. Klishin",
22
22
  "Stefan Kaes"]
23
23
 
24
- s.email = ["mklishin@pivotal.io"]
24
+ s.email = ["michael.s.klishin@gmail.com"]
25
25
 
26
26
  # Dependencies
27
- s.add_runtime_dependency 'amq-protocol', '~> 2.3', '>= 2.3.0'
27
+ s.add_runtime_dependency 'amq-protocol', '~> 2.3', '>= 2.3.1'
28
28
 
29
29
  # Files.
30
30
  s.extra_rdoc_files = ["README.md"]
@@ -158,9 +158,6 @@ module Bunny
158
158
  # @option opts [Boolean] :ack (false) [DEPRECATED] Use :manual_ack instead
159
159
  # @option opts [Boolean] :manual_ack (false) Will this consumer use manual acknowledgements?
160
160
  # @option opts [Boolean] :exclusive (false) Should this consumer be exclusive for this queue?
161
- # @option opts [Boolean] :block (false) Should the call block the calling thread? This option can be useful for keeping the main thread of
162
- # a script alive. It is incompatible with automatic connection recovery
163
- # and is not generally recommended.
164
161
  # @option opts [#call] :on_cancellation Block to execute when this consumer is cancelled remotely (e.g. via the RabbitMQ Management plugin)
165
162
  # @option opts [String] :consumer_tag Unique consumer identifier. It is usually recommended to let Bunny generate it for you.
166
163
  # @option opts [Hash] :arguments ({}) Additional (optional) arguments, typically used by RabbitMQ extensions
@@ -342,6 +342,14 @@ module Bunny
342
342
  self
343
343
  end
344
344
 
345
+ def update_secret(value, reason)
346
+ @transport.send_frame(AMQ::Protocol::Connection::UpdateSecret.encode(value, reason))
347
+ @last_update_secret_ok = wait_on_continuations
348
+ raise_if_continuation_resulted_in_a_connection_error!
349
+
350
+ @last_update_secret_ok
351
+ end
352
+
345
353
  # Socket operation write timeout used by this connection
346
354
  # @return [Integer]
347
355
  # @private
@@ -632,6 +640,8 @@ module Bunny
632
640
  when AMQ::Protocol::Connection::Unblocked then
633
641
  @blocked = false
634
642
  @unblock_callback.call(method) if @unblock_callback
643
+ when AMQ::Protocol::Connection::UpdateSecretOk then
644
+ @continuations.push(method)
635
645
  when AMQ::Protocol::Channel::Close then
636
646
  begin
637
647
  ch = synchronised_find_channel(ch_number)
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "2.14.4"
5
+ VERSION = "2.15.0"
6
6
  end
data/repl CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/bin/sh
2
2
 
3
- bundle exec ruby -w `which ripl` -Ilib -r'bunny' -r'ripl/multi_line' -r'ripl/irb'
3
+ bundle exec ruby `which ripl` -Ilib -r'bunny' -r'ripl/multi_line' -r'ripl/irb'
@@ -20,7 +20,7 @@ describe Bunny::Consumer, "#cancel" do
20
20
  t = Thread.new do
21
21
  ch = connection.create_channel
22
22
  q = ch.queue(queue_name, auto_delete: true, durable: false)
23
- consumer = q.subscribe(block: false) do |_, _, payload|
23
+ consumer = q.subscribe do |_, _, payload|
24
24
  delivered_data << payload
25
25
  end
26
26
 
@@ -58,7 +58,7 @@ describe Bunny::Consumer, "#cancel" do
58
58
  delivered_data << payload
59
59
  end
60
60
 
61
- q.subscribe_with(consumer, block: false)
61
+ q.subscribe_with(consumer)
62
62
  end
63
63
  t.abort_on_exception = true
64
64
  sleep 1.0
@@ -91,7 +91,7 @@ describe Bunny::Consumer, "#cancel" do
91
91
  delivered_data << payload
92
92
  end
93
93
 
94
- q.subscribe_with(consumer, block: false)
94
+ q.subscribe_with(consumer)
95
95
  end
96
96
  t.abort_on_exception = true
97
97
  sleep 1.0
@@ -122,7 +122,7 @@ describe Bunny::Consumer, "#cancel" do
122
122
  delivered_data << payload
123
123
  end
124
124
 
125
- q.subscribe_with(consumer, block: false)
125
+ q.subscribe_with(consumer)
126
126
  end
127
127
  t.abort_on_exception = true
128
128
  sleep 1.0
@@ -189,17 +189,17 @@ describe Bunny::Queue, "#subscribe" do
189
189
  ch = connection.create_channel
190
190
  q = ch.queue(queue_name)
191
191
 
192
- c1 = q.subscribe(exclusive: false, manual_ack: false, block: false) do |delivery_info, properties, payload|
192
+ c1 = q.subscribe(exclusive: false, manual_ack: false) do |delivery_info, properties, payload|
193
193
  end
194
194
  c1.cancel
195
195
 
196
- c2 = q.subscribe(exclusive: false, manual_ack: false, block: false) do |delivery_info, properties, payload|
196
+ c2 = q.subscribe(exclusive: false, manual_ack: false) do |delivery_info, properties, payload|
197
197
  delivered_keys << delivery_info.routing_key
198
198
  delivered_data << payload
199
199
  end
200
200
  c2.cancel
201
201
 
202
- q.subscribe(exclusive: false, manual_ack: false, block: true) do |delivery_info, properties, payload|
202
+ q.subscribe(exclusive: false, manual_ack: false) do |delivery_info, properties, payload|
203
203
  delivered_keys << delivery_info.routing_key
204
204
  delivered_data << payload
205
205
  end
@@ -3,248 +3,260 @@ require "spec_helper"
3
3
 
4
4
  require "socket"
5
5
 
6
- unless ENV["CI"]
7
- CERTIFICATE_DIR = ENV.fetch("BUNNY_CERTIFICATE_DIR", "./spec/tls")
8
- puts "Will use certificates from #{CERTIFICATE_DIR}"
9
-
10
- shared_examples_for "successful TLS connection" do
11
- it "succeeds" do
12
- expect(subject).to be_tls
13
- ch = subject.create_channel
14
- ch.confirm_select
15
-
16
- q = ch.queue("", exclusive: true)
17
- x = ch.default_exchange
18
-
19
- x.publish("xyzzy", routing_key: q.name).
20
- publish("xyzzy", routing_key: q.name).
21
- publish("xyzzy", routing_key: q.name).
22
- publish("xyzzy", routing_key: q.name)
23
-
24
- x.wait_for_confirms
25
- expect(q.message_count).to eq 4
26
-
27
- i = 0
28
- q.subscribe do |delivery_info, _, payload|
29
- i += 1
30
- end
31
- sleep 1.0
32
- expect(i).to eq 4
33
- expect(q.message_count).to eq 0
34
-
35
- ch.close
36
- end
37
- end
6
+ CERTIFICATE_DIR = ENV.fetch("BUNNY_CERTIFICATE_DIR", "./spec/tls")
7
+ puts "Will use certificates from #{CERTIFICATE_DIR}"
38
8
 
39
- def local_hostname
40
- ENV.fetch("BUNNY_RABBITMQ_HOSTNAME", "localhost")
41
- end
9
+ shared_examples_for "successful TLS connection" do
10
+ it "succeeds", skip: ENV["CI"] do
11
+ expect(subject).to be_tls
12
+ ch = subject.create_channel
13
+ ch.confirm_select
14
+
15
+ q = ch.queue("", exclusive: true)
16
+ x = ch.default_exchange
17
+
18
+ x.publish("xyzzy", routing_key: q.name).
19
+ publish("xyzzy", routing_key: q.name).
20
+ publish("xyzzy", routing_key: q.name).
21
+ publish("xyzzy", routing_key: q.name)
42
22
 
43
- context "initialized with :tls => true" do
44
- let(:subject) do
45
- Bunny.new(
46
- hostname: local_hostname(),
47
- user: "bunny_gem",
48
- password: "bunny_password",
49
- vhost: "bunny_testbed",
50
- tls: true,
51
- verify_peer: verify_peer,
52
- tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
53
- tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
54
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"])
23
+ x.wait_for_confirms
24
+ expect(q.message_count).to eq 4
25
+
26
+ i = 0
27
+ q.subscribe do |delivery_info, _, payload|
28
+ i += 1
55
29
  end
30
+ sleep 1.0
31
+ expect(i).to eq 4
32
+ expect(q.message_count).to eq 0
56
33
 
57
- context "peer verification is off" do
58
- let(:verify_peer) { false }
34
+ ch.close
35
+ end
36
+ end
59
37
 
60
- it "uses TLS port" do
61
- expect(subject.port).to eq AMQ::Protocol::TLS_PORT
62
- end
38
+ def local_hostname
39
+ ENV.fetch("BUNNY_RABBITMQ_HOSTNAME", "localhost")
40
+ end
63
41
 
64
- it "sends the SNI details" do
65
- # https://github.com/ruby-amqp/bunny/issues/440
66
- subject.start
67
- expect(subject.transport.socket.hostname).to_not be_empty
68
- end
42
+ def no_tls12_supported?
43
+ not tls12_supported?
44
+ end
69
45
 
70
- after :each do
71
- subject.close
72
- end
73
- end
46
+ def tls12_supported?
47
+ begin
48
+ ctx = OpenSSL::SSL::SSLContext.new
49
+ ctx.min_version = ctx.max_version = OpenSSL::SSL::TLS1_2_VERSION
50
+ true
51
+ rescue
52
+ false
53
+ end
54
+ end
74
55
 
75
- context "peer verification is on" do
76
- let(:verify_peer) { true }
56
+ context "initialized with tls: true", skip: ENV["CI"] do
57
+ let(:subject) do
58
+ Bunny.new(
59
+ hostname: local_hostname(),
60
+ user: "bunny_gem",
61
+ password: "bunny_password",
62
+ vhost: "bunny_testbed",
63
+ tls: true,
64
+ verify_peer: verify_peer,
65
+ tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
66
+ tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
67
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"])
68
+ end
69
+
70
+ context "peer verification is off" do
71
+ let(:verify_peer) { false }
77
72
 
78
- it "uses TLS port" do
79
- expect(subject.port).to eq AMQ::Protocol::TLS_PORT
80
- end
73
+ it "uses TLS port" do
74
+ expect(subject.port).to eq AMQ::Protocol::TLS_PORT
81
75
  end
82
- end
83
76
 
84
- describe "TLS connection to RabbitMQ with client certificates" do
85
- let(:subject) do
86
- c = Bunny.new(
87
- hostname: local_hostname(),
88
- username: "bunny_gem",
89
- password: "bunny_password",
90
- vhost: "bunny_testbed",
91
- tls: true,
92
- tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
93
- tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
94
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
95
- verify_peer: false)
96
- c.start
97
- c
77
+ it "sends the SNI details" do
78
+ # https://github.com/ruby-amqp/bunny/issues/440
79
+ subject.start
80
+ expect(subject.transport.socket.hostname).to_not be_empty
98
81
  end
99
82
 
100
83
  after :each do
101
84
  subject.close
102
85
  end
103
-
104
- include_examples "successful TLS connection"
105
86
  end
106
87
 
88
+ context "peer verification is on" do
89
+ let(:verify_peer) { true }
107
90
 
108
- describe "TLS connection to RabbitMQ without client certificates" do
109
- let(:subject) do
110
- c = Bunny.new(
111
- hostname: local_hostname(),
112
- username: "bunny_gem",
113
- password: "bunny_password",
114
- vhost: "bunny_testbed",
115
- tls: true,
116
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
117
- verify_peer: false)
118
- c.start
119
- c
91
+ it "uses TLS port" do
92
+ expect(subject.port).to eq AMQ::Protocol::TLS_PORT
120
93
  end
94
+ end
95
+ end
121
96
 
122
- after :each do
123
- subject.close
124
- end
97
+ describe "TLS connection to RabbitMQ with client certificates", skip: ENV["CI"] do
98
+ let(:subject) do
99
+ c = Bunny.new(
100
+ hostname: local_hostname(),
101
+ username: "bunny_gem",
102
+ password: "bunny_password",
103
+ vhost: "bunny_testbed",
104
+ tls: true,
105
+ tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
106
+ tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
107
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
108
+ verify_peer: false)
109
+ c.start
110
+ c
111
+ end
125
112
 
126
- include_examples "successful TLS connection"
113
+ after :each do
114
+ subject.close
127
115
  end
128
116
 
117
+ include_examples "successful TLS connection"
118
+ end
129
119
 
130
- describe "TLS connection to RabbitMQ with a connection string" do
131
- let(:subject) do
132
- c = Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed",
133
- tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
134
- tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
135
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
136
- verify_peer: false)
137
- c.start
138
- c
139
- end
140
120
 
141
- after :each do
142
- subject.close
143
- end
121
+ describe "TLS connection to RabbitMQ without client certificates", skip: ENV["CI"] do
122
+ let(:subject) do
123
+ c = Bunny.new(
124
+ hostname: local_hostname(),
125
+ username: "bunny_gem",
126
+ password: "bunny_password",
127
+ vhost: "bunny_testbed",
128
+ tls: true,
129
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
130
+ verify_peer: false)
131
+ c.start
132
+ c
133
+ end
144
134
 
145
- include_examples "successful TLS connection"
135
+ after :each do
136
+ subject.close
137
+ end
146
138
 
147
- context "when URI contains query parameters" do
148
- subject(:session) do
149
- Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed?heartbeat=10&connection_timeout=100&channel_max=1000&verify=false&cacertfile=#{CERTIFICATE_DIR}/ca_certificate.pem&certfile=#{CERTIFICATE_DIR}/client_certificate.pem&keyfile=#{CERTIFICATE_DIR}/client_key.pem")
150
- end
139
+ include_examples "successful TLS connection"
140
+ end
151
141
 
152
- it "parses extra connection parameters" do
153
- session.start
154
142
 
155
- expect(session.uses_tls?).to eq(true)
156
- expect(session.transport.verify_peer).to eq(false)
157
- expect(session.transport.tls_ca_certificates).to eq(["#{CERTIFICATE_DIR}/ca_certificate.pem"])
158
- expect(session.transport.tls_certificate_path).to eq("#{CERTIFICATE_DIR}/client_certificate.pem")
159
- expect(session.transport.tls_key_path).to eq("#{CERTIFICATE_DIR}/client_key.pem")
160
- end
161
- end
143
+ describe "TLS connection to RabbitMQ with a connection string", skip: ENV["CI"] do
144
+ let(:subject) do
145
+ c = Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed",
146
+ tls_cert: "#{CERTIFICATE_DIR}/client_certificate.pem",
147
+ tls_key: "#{CERTIFICATE_DIR}/client_key.pem",
148
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
149
+ verify_peer: false)
150
+ c.start
151
+ c
162
152
  end
163
153
 
154
+ after :each do
155
+ subject.close
156
+ end
164
157
 
165
- describe "TLS connection to RabbitMQ with a connection string and w/o client certificate and key" do
166
- let(:subject) do
167
- c = Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed",
168
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
169
- verify_peer: verify_peer)
170
- c.start
171
- c
158
+ include_examples "successful TLS connection"
159
+
160
+ context "when URI contains query parameters" do
161
+ subject(:session) do
162
+ Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed?heartbeat=10&connection_timeout=100&channel_max=1000&verify=false&cacertfile=#{CERTIFICATE_DIR}/ca_certificate.pem&certfile=#{CERTIFICATE_DIR}/client_certificate.pem&keyfile=#{CERTIFICATE_DIR}/client_key.pem")
172
163
  end
173
164
 
174
- after :each do
175
- subject.close
165
+ it "parses extra connection parameters" do
166
+ session.start
167
+
168
+ expect(session.uses_tls?).to eq(true)
169
+ expect(session.transport.verify_peer).to eq(false)
170
+ expect(session.transport.tls_ca_certificates).to eq(["#{CERTIFICATE_DIR}/ca_certificate.pem"])
171
+ expect(session.transport.tls_certificate_path).to eq("#{CERTIFICATE_DIR}/client_certificate.pem")
172
+ expect(session.transport.tls_key_path).to eq("#{CERTIFICATE_DIR}/client_key.pem")
176
173
  end
174
+ end
175
+ end
177
176
 
178
- context "peer verification is off" do
179
- let(:verify_peer) { false }
180
177
 
181
- include_examples "successful TLS connection"
178
+ describe "TLS connection to RabbitMQ with a connection string and w/o client certificate and key", skip: ENV["CI"] do
179
+ let(:subject) do
180
+ c = Bunny.new("amqps://bunny_gem:bunny_password@#{local_hostname()}/bunny_testbed",
181
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
182
+ verify_peer: verify_peer)
183
+ c.start
184
+ c
185
+ end
182
186
 
183
- it "sends the SNI details" do
184
- # https://github.com/ruby-amqp/bunny/issues/440
185
- expect(subject.transport.socket.hostname).to_not be_empty
186
- end
187
- end
187
+ after :each do
188
+ subject.close
189
+ end
188
190
 
189
- context "peer verification is on" do
190
- let(:verify_peer) { true }
191
+ context "peer verification is off" do
192
+ let(:verify_peer) { false }
191
193
 
192
- include_examples "successful TLS connection"
194
+ include_examples "successful TLS connection"
193
195
 
194
- it "sends the SNI details" do
195
- # https://github.com/ruby-amqp/bunny/issues/440
196
- expect(subject.transport.socket.hostname).to_not be_empty
197
- end
196
+ it "sends the SNI details" do
197
+ # https://github.com/ruby-amqp/bunny/issues/440
198
+ expect(subject.transport.socket.hostname).to_not be_empty
198
199
  end
199
200
  end
200
201
 
202
+ context "peer verification is on" do
203
+ let(:verify_peer) { true }
201
204
 
202
- describe "TLS connection to RabbitMQ with client certificates provided inline" do
203
- let(:subject) do
204
- c = Bunny.new(
205
- hostname: local_hostname(),
206
- username: "bunny_gem",
207
- password: "bunny_password",
208
- vhost: "bunny_testbed",
209
- tls: true,
210
- tls_cert: File.read("#{CERTIFICATE_DIR}/client_certificate.pem"),
211
- tls_key: File.read("#{CERTIFICATE_DIR}/client_key.pem"),
212
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
213
- verify_peer: false)
214
- c.start
215
- c
216
- end
205
+ include_examples "successful TLS connection"
217
206
 
218
- after :each do
219
- subject.close
207
+ it "sends the SNI details" do
208
+ # https://github.com/ruby-amqp/bunny/issues/440
209
+ expect(subject.transport.socket.hostname).to_not be_empty
220
210
  end
211
+ end
212
+ end
221
213
 
222
- include_examples "successful TLS connection"
214
+
215
+ describe "TLS connection to RabbitMQ with client certificates provided inline", skip: ENV["CI"] do
216
+ let(:subject) do
217
+ c = Bunny.new(
218
+ hostname: local_hostname(),
219
+ username: "bunny_gem",
220
+ password: "bunny_password",
221
+ vhost: "bunny_testbed",
222
+ tls: true,
223
+ tls_cert: File.read("#{CERTIFICATE_DIR}/client_certificate.pem"),
224
+ tls_key: File.read("#{CERTIFICATE_DIR}/client_key.pem"),
225
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
226
+ verify_peer: false)
227
+ c.start
228
+ c
223
229
  end
224
230
 
225
- describe "TLS connection to RabbitMQ with tls_version TLSv1.1 specified" do
226
- let(:subject) do
227
- c = Bunny.new(
228
- hostname: local_hostname(),
229
- username: "bunny_gem",
230
- password: "bunny_password",
231
- vhost: "bunny_testbed",
232
- tls: true,
233
- tls_protocol: :TLSv1_1,
234
- tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
235
- verify_peer: false)
236
- c.start
237
- c
238
- end
231
+ after :each do
232
+ subject.close
233
+ end
239
234
 
240
- after :each do
241
- subject.close
242
- end
235
+ include_examples "successful TLS connection"
236
+ end
243
237
 
244
- include_examples "successful TLS connection"
238
+ describe "TLS connection to RabbitMQ with tls_version TLSv1.2 specified", skip: ENV["CI"] do
239
+ let(:subject) do
240
+ c = Bunny.new(
241
+ hostname: local_hostname(),
242
+ username: "bunny_gem",
243
+ password: "bunny_password",
244
+ vhost: "bunny_testbed",
245
+ tls: true,
246
+ tls_protocol: :TLSv1_2,
247
+ tls_ca_certificates: ["#{CERTIFICATE_DIR}/ca_certificate.pem"],
248
+ verify_peer: false)
249
+ c.start
250
+ c
251
+ end
245
252
 
246
- it "connects using TLSv1.1" do
247
- expect(subject.transport.socket.ssl_version).to eq "TLSv1.1"
248
- end
253
+ after :each do
254
+ subject.close
255
+ end
256
+
257
+ include_examples "successful TLS connection"
258
+
259
+ it "connects using TLSv1.2", skip: no_tls12_supported? do
260
+ expect(subject.transport.socket.ssl_version).to eq "TLSv1.2"
249
261
  end
250
262
  end
@@ -4,7 +4,7 @@ describe Bunny::Session do
4
4
  context "with unreachable host" do
5
5
  it "raises Bunny::TCPConnectionFailed" do
6
6
  begin
7
- conn = Bunny.new(:hostname => "192.192.192.192")
7
+ conn = Bunny.new(:hostname => "127.0.0.254", :port => 1433)
8
8
  conn.start
9
9
 
10
10
  fail "expected 192.192.192.192 to be unreachable"
@@ -24,7 +24,7 @@ unless ENV["CI"]
24
24
  ch2 = @connection1.create_channel
25
25
 
26
26
  q = ch1.queue("", exclusive: true)
27
- q.subscribe(manual_ack: false, block: false) do |delivery_info, properties, payload|
27
+ q.subscribe(manual_ack: false) do |delivery_info, properties, payload|
28
28
  delivered_data << payload
29
29
  end
30
30
  sleep 0.5
@@ -57,7 +57,7 @@ unless ENV["CI"]
57
57
  sleep 0.7
58
58
  expect(q.message_count).to eq 3
59
59
 
60
- q.subscribe(manual_ack: false, block: false) do |delivery_info, properties, payload|
60
+ q.subscribe(manual_ack: false) do |delivery_info, properties, payload|
61
61
  delivered_data << payload
62
62
  end
63
63
  sleep 0.7
@@ -1,5 +1,5 @@
1
- require_relative '../../lib/bunny/channel'
2
- require_relative '../../lib/bunny/exchange'
1
+ require 'bunny/channel'
2
+ require 'bunny/exchange'
3
3
 
4
4
  module Bunny
5
5
  describe Exchange do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.4
4
+ version: 2.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Duncan
@@ -12,31 +12,32 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2020-02-11 00:00:00.000000000 Z
15
+ date: 2020-04-08 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: amq-protocol
19
19
  requirement: !ruby/object:Gem::Requirement
20
20
  requirements:
21
- - - ">="
22
- - !ruby/object:Gem::Version
23
- version: 2.3.0
24
21
  - - "~>"
25
22
  - !ruby/object:Gem::Version
26
23
  version: '2.3'
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 2.3.1
27
27
  type: :runtime
28
28
  prerelease: false
29
29
  version_requirements: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: 2.3.0
34
31
  - - "~>"
35
32
  - !ruby/object:Gem::Version
36
33
  version: '2.3'
37
- description: Easy to use, feature complete Ruby client for RabbitMQ
34
+ - - ">="
35
+ - !ruby/object:Gem::Version
36
+ version: 2.3.1
37
+ description: Easy to use, feature complete Ruby client for RabbitMQ 3.3 and later
38
+ versions.
38
39
  email:
39
- - mklishin@pivotal.io
40
+ - michael.s.klishin@gmail.com
40
41
  executables: []
41
42
  extensions: []
42
43
  extra_rdoc_files:
@@ -240,10 +241,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
240
241
  - !ruby/object:Gem::Version
241
242
  version: '0'
242
243
  requirements: []
243
- rubygems_version: 3.0.3
244
+ rubygems_version: 3.1.2
244
245
  signing_key:
245
246
  specification_version: 4
246
- summary: Easy to use Ruby client for RabbitMQ
247
+ summary: Popular easy to use Ruby client for RabbitMQ
247
248
  test_files:
248
249
  - spec/config/enabled_plugins
249
250
  - spec/config/rabbitmq.conf