bunny 2.7.4 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +15 -28
- data/Gemfile +1 -1
- data/bunny.gemspec +1 -1
- data/lib/bunny/channel.rb +10 -1
- data/lib/bunny/queue.rb +3 -1
- data/lib/bunny/version.rb +1 -1
- data/spec/higher_level_api/integration/channel_close_spec.rb +46 -9
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4233cd136f781586c6c21f3e6abae2052a0aefdf
|
4
|
+
data.tar.gz: 359da718cb420fadb31d4f67f9b23557d1d03ddf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4c5f6c2ae11023b9fe6a45b66fdb7b97f2aa07b89ba7f39cf6d5a2f2c27c7dce1bdc9e3a303d41c1ef067268247617f9e19618e0ac8b58a846ca1452307c050
|
7
|
+
data.tar.gz: df6aeb03ba7a97a8b864d471bf76eccdf29415bf11db84e8ec9034636de65377ecb1e7bdc9cb4475ad944164d714586a5cc144ab52d1539e08f8761f152b2fbe
|
data/ChangeLog.md
CHANGED
@@ -1,18 +1,15 @@
|
|
1
|
-
## Changes between Bunny 2.7.
|
1
|
+
## Changes between Bunny 2.7.0 and 2.8.0 (unreleased)
|
2
2
|
|
3
|
-
|
3
|
+
This release has **minor breaking public API changes**.
|
4
4
|
|
5
|
+
### `Bunny::Channel#close` on a Closed Channel Now Raises a Sensible Exception
|
5
6
|
|
6
|
-
|
7
|
+
`Bunny::Channel#close` on an already closed channel will now raise a sensible exception.
|
8
|
+
If the channel was closed due to a channel-level protocol exception, that exception will
|
9
|
+
be mentioned.
|
7
10
|
|
8
|
-
|
9
|
-
|
10
|
-
This version depends on amq-protocol `2.2.x`.
|
11
|
-
|
12
|
-
GitHub issue: [#538](https://github.com/ruby-amqp/bunny/issues/538).
|
13
|
-
|
14
|
-
|
15
|
-
## Changes between Bunny 2.7.2 and 2.7.3 (Dec 19th, 2017)
|
11
|
+
GitHub issue: [#528](https://github.com/ruby-amqp/bunny/issues/528), see [9df7cb](https://github.com/ruby-amqp/bunny/commit/9df7cb04d9ff12b1af62a11e239fd81e5472c872) for
|
12
|
+
details.
|
16
13
|
|
17
14
|
### JRuby 9K Compatibility
|
18
15
|
|
@@ -20,7 +17,7 @@ A JRuby 9K compatibility issue was corrected by Marian Posăceanu.
|
|
20
17
|
Note that JRuby users are recommended to use [March Hare](http://rubymarchhare.info/), a JRuby-oriented client, instead
|
21
18
|
of Bunny.
|
22
19
|
|
23
|
-
GitHub issue: [#529](https://github.com/ruby-amqp/bunny/pull/529)
|
20
|
+
GitHub issue: [bunny#529](https://github.com/ruby-amqp/bunny/pull/529)
|
24
21
|
|
25
22
|
### Connection Exceptions are Logged as Warning with Automatic Recovery
|
26
23
|
|
@@ -29,26 +26,16 @@ and not errors.
|
|
29
26
|
|
30
27
|
Contributed by Merten Falk.
|
31
28
|
|
32
|
-
GitHub issue: [#531](https://github.com/ruby-amqp/bunny/pull/531)
|
33
|
-
|
34
|
-
|
35
|
-
## Changes between Bunny 2.7.1 and 2.7.2 (Nov 4th, 2017)
|
36
|
-
|
37
|
-
### Heartbeat Value Supports `:server` and `"server"`
|
38
|
-
|
39
|
-
Heartbeat value of `:server` now can be specified as a string.
|
40
|
-
|
41
|
-
Contributed by Tyrone.
|
42
|
-
|
29
|
+
GitHub issue: [bunny#531](https://github.com/ruby-amqp/bunny/pull/531)
|
43
30
|
|
44
|
-
###
|
31
|
+
### Server Heartbeat Value as a String
|
45
32
|
|
46
|
-
|
47
|
-
|
33
|
+
It is now possible to specify a server-defined heartbeat value as a string (`"server"`), not just
|
34
|
+
a symbol. This makes it easier to load settings from YAML files.
|
48
35
|
|
49
|
-
|
36
|
+
Contributed by Tyrone Wilson.
|
50
37
|
|
51
|
-
|
38
|
+
GitHub issue: [bunny#524](https://github.com/ruby-amqp/bunny/pull/524)
|
52
39
|
|
53
40
|
|
54
41
|
## Changes between Bunny 2.7.0 and 2.7.1 (Sep 25th, 2017)
|
data/Gemfile
CHANGED
data/bunny.gemspec
CHANGED
data/lib/bunny/channel.rb
CHANGED
@@ -233,6 +233,9 @@ module Bunny
|
|
233
233
|
# {Bunny::Queue}, {Bunny::Exchange} and {Bunny::Consumer} instances.
|
234
234
|
# @api public
|
235
235
|
def close
|
236
|
+
# see bunny#528
|
237
|
+
raise_if_no_longer_open!
|
238
|
+
|
236
239
|
@connection.close_channel(self)
|
237
240
|
@status = :closed
|
238
241
|
@work_pool.shutdown
|
@@ -1940,7 +1943,13 @@ module Bunny
|
|
1940
1943
|
|
1941
1944
|
# @private
|
1942
1945
|
def raise_if_no_longer_open!
|
1943
|
-
|
1946
|
+
if closed?
|
1947
|
+
if @last_channel_error
|
1948
|
+
raise ChannelAlreadyClosed.new("cannot use a closed channel! Channel id: #{@id}, closed due to a server-reported channel error: #{@last_channel_error.message}", self)
|
1949
|
+
else
|
1950
|
+
raise ChannelAlreadyClosed.new("cannot use a closed channel! Channel id: #{@id}", self)
|
1951
|
+
end
|
1952
|
+
end
|
1944
1953
|
end
|
1945
1954
|
|
1946
1955
|
# @private
|
data/lib/bunny/queue.rb
CHANGED
@@ -158,7 +158,9 @@ 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 calling thread?
|
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.
|
162
164
|
# @option opts [#call] :on_cancellation Block to execute when this consumer is cancelled remotely (e.g. via the RabbitMQ Management plugin)
|
163
165
|
# @option opts [String] :consumer_tag Unique consumer identifier. It is usually recommended to let Bunny generate it for you.
|
164
166
|
# @option opts [Hash] :arguments ({}) Additional (optional) arguments, typically used by RabbitMQ extensions
|
data/lib/bunny/version.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
describe Bunny::Channel
|
3
|
+
describe Bunny::Channel do
|
4
4
|
let(:connection) do
|
5
5
|
c = Bunny.new(username: "bunny_gem", password: "bunny_password", vhost: "bunny_testbed")
|
6
6
|
c.start
|
@@ -11,15 +11,52 @@ describe Bunny::Channel, "when closed" do
|
|
11
11
|
connection.close
|
12
12
|
end
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
context "when closed" do
|
15
|
+
it "releases the id" do
|
16
|
+
ch = connection.create_channel
|
17
|
+
n = ch.number
|
17
18
|
|
18
|
-
|
19
|
-
|
20
|
-
|
19
|
+
expect(ch).to be_open
|
20
|
+
ch.close
|
21
|
+
expect(ch).to be_closed
|
21
22
|
|
22
|
-
|
23
|
-
|
23
|
+
# a new channel with the same id can be created
|
24
|
+
connection.create_channel(n)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
context "when double closed" do
|
29
|
+
# bunny#528
|
30
|
+
it "raises a meaningful exception" do
|
31
|
+
ch = connection.create_channel
|
32
|
+
|
33
|
+
expect(ch).to be_open
|
34
|
+
ch.close
|
35
|
+
expect(ch).to be_closed
|
36
|
+
|
37
|
+
expect { ch.close }.to raise_error(Bunny::ChannelAlreadyClosed)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
context "when double closed after a channel-level protocol exception" do
|
42
|
+
# bunny#528
|
43
|
+
it "raises a meaningful exception" do
|
44
|
+
ch = connection.create_channel
|
45
|
+
|
46
|
+
s = "bunny-temp-q-#{rand}"
|
47
|
+
|
48
|
+
expect(ch).to be_open
|
49
|
+
ch.queue_declare(s, durable: false, exclusive: true)
|
50
|
+
|
51
|
+
expect do
|
52
|
+
ch.queue_declare(s, durable: true, exclusive: false)
|
53
|
+
end.to raise_error(Bunny::PreconditionFailed)
|
54
|
+
|
55
|
+
# channel.close is sent and handled concurrently with the test
|
56
|
+
sleep 1
|
57
|
+
expect(ch).to be_closed
|
58
|
+
|
59
|
+
expect { ch.close }.to raise_error(Bunny::ChannelAlreadyClosed)
|
60
|
+
end
|
24
61
|
end
|
25
62
|
end
|
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.
|
4
|
+
version: 2.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Duncan
|
@@ -12,20 +12,20 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date:
|
15
|
+
date: 2017-12-18 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
|
-
- - "
|
21
|
+
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: 2.2.0
|
24
24
|
type: :runtime
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - "
|
28
|
+
- - ">="
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: 2.2.0
|
31
31
|
description: Easy to use, feature complete Ruby client for RabbitMQ 3.3 and later
|
@@ -232,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
232
232
|
version: '0'
|
233
233
|
requirements: []
|
234
234
|
rubyforge_project:
|
235
|
-
rubygems_version: 2.6.
|
235
|
+
rubygems_version: 2.6.11
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: Popular easy to use Ruby client for RabbitMQ
|