bunny 2.3.1 → 2.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +71 -5
- data/ChangeLog.md +28 -1
- data/README.md +4 -48
- data/Rakefile +27 -0
- data/docker/Dockerfile +14 -0
- data/docker/docker-entrypoint.sh +40 -0
- data/lib/bunny.rb +2 -2
- data/lib/bunny/channel.rb +5 -23
- data/lib/bunny/queue.rb +0 -1
- data/lib/bunny/reader_loop.rb +2 -2
- data/lib/bunny/session.rb +4 -4
- data/lib/bunny/version.rb +1 -1
- data/spec/higher_level_api/integration/basic_qos_spec.rb +8 -2
- data/spec/stress/concurrent_consumers_stress_spec.rb +9 -6
- data/spec/stress/concurrent_publishers_stress_spec.rb +11 -14
- data/spec/stress/wait_for_confirms_with_connection_loss_stress_spec.rb +131 -0
- data/spec/tls/ca_certificate.pem +16 -16
- data/spec/tls/ca_key.pem +25 -25
- data/spec/tls/client_certificate.pem +16 -16
- data/spec/tls/client_key.pem +25 -25
- data/spec/tls/server_certificate.pem +16 -16
- data/spec/tls/server_key.pem +25 -25
- metadata +9 -9
- data/spec/tls/cacert.pem +0 -18
- data/spec/tls/client_cert.pem +0 -18
- data/spec/tls/server_cert.pem +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 790cbbf1db8e302bc827c5bea5f7402246666232
|
4
|
+
data.tar.gz: 5db72065394300e1836777389d4cefc96f2213b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a209a0ee2b9d6bb19616d647f7070dbf6834aff8faa3136e1ae452fa0aae5980c9bc4bffedb6a8f4062f92b3469580936c3c94deca3d386120543ae11f737538
|
7
|
+
data.tar.gz: ca0250521c37790299f627edf42db7598ddfe21d1cfd749f84745f5003c160d3c12fa52dbbb3c899aa709125f715bfe55c53697ef2bf05b0db89ec98b5ad6934
|
data/CONTRIBUTING.md
CHANGED
@@ -1,12 +1,78 @@
|
|
1
1
|
## Pre-requisites
|
2
2
|
|
3
|
-
The project uses Bundler for dependency management and requires RabbitMQ `3.
|
4
|
-
locally
|
5
|
-
|
6
|
-
|
3
|
+
The project uses Bundler for dependency management and requires RabbitMQ `3.5+` to be running
|
4
|
+
locally with the `rabbitmq-management` and `rabbitmq_consistent_hash_exchange` plugins enabled.
|
5
|
+
|
6
|
+
|
7
|
+
### Running the Specs
|
8
|
+
|
9
|
+
The specs require RabbitMQ to be running locally with a specific set of vhosts
|
10
|
+
and users. RabbitMQ can be provisioned and started any way that's convenient to you
|
11
|
+
as long as it has a suitable TLS keys configuration and management plugin enabled.
|
12
|
+
Make sure you have a recent version of RabbitMQ (> `3.5.3`).
|
13
|
+
|
14
|
+
You can also start a clean RabbitMQ server
|
15
|
+
node on your machine specifically for the bunny specs.
|
16
|
+
This can be done either by using a locally installed RabbitMQ server or by
|
17
|
+
running a RabbitMQ server in a Docker container.
|
18
|
+
|
19
|
+
#### Using a locally installed RabbitMQ server
|
20
|
+
|
21
|
+
Run the following command from the base directory of the gem:
|
22
|
+
|
23
|
+
```
|
24
|
+
RABBITMQ_NODENAME=bunny RABBITMQ_CONFIG_FILE=./spec/config/rabbitmq RABBITMQ_ENABLED_PLUGINS_FILE=./spec/config/enabled_plugins rabbitmq-server
|
25
|
+
```
|
26
|
+
|
27
|
+
The specs use the RabbitMQ management plugin and require a TLS port to be available. The config files in the spec/config directory enable these.
|
28
|
+
|
29
|
+
Next up you'll need to prepare your node for the specs (just once):
|
30
|
+
|
31
|
+
```
|
32
|
+
RABBITMQ_NODENAME=bunny ./bin/ci/before_build
|
33
|
+
```
|
34
|
+
|
35
|
+
And then run the core integration suite:
|
36
|
+
|
37
|
+
```
|
38
|
+
RABBITMQ_NODENAME=bunny CI=true rspec
|
39
|
+
```
|
40
|
+
|
41
|
+
#### Running a RabbitMQ server in a Docker container
|
42
|
+
|
43
|
+
First off you have to [install Docker](https://docs.docker.com/engine/installation/) (>= 1.9).
|
44
|
+
|
45
|
+
After Docker has been installed (and the `docker` command is available on your command line path), run
|
46
|
+
|
47
|
+
./bin/ci/start_rabbitmq
|
48
|
+
|
49
|
+
The first time you do this, it will take some time, since it has to download everything it needs
|
50
|
+
to build the Docker image.
|
51
|
+
|
52
|
+
The RabbitMQ server will run in the foreground in the terminal where you started it. You can stop
|
53
|
+
it by pressing CTRL+C.
|
54
|
+
|
55
|
+
### Running Test Suites
|
56
|
+
|
57
|
+
Prior to running the tests, configure the RabbitMQ permissions
|
58
|
+
by running `./bin/ci/before_script`. The script uses `rabbitmqctl` and `rabbitmq-plugins`
|
59
|
+
to set up RabbitMQ in a way that Bunny test suites expect. Two environment variables,
|
60
|
+
`RABBITMQCTL` and `RABBITMQ_PLUGINS`, are available to control what `rabbitmqctl` and
|
61
|
+
`rabbitmq-plugins` commands will be used. By default they are taken from `PATH`
|
62
|
+
and prefixed with `sudo`.
|
63
|
+
|
64
|
+
Make sure you have those two installed and then run integration tests:
|
7
65
|
|
8
66
|
bundle install
|
9
|
-
|
67
|
+
rake integration
|
68
|
+
|
69
|
+
It is possible to run all tests:
|
70
|
+
|
71
|
+
bundle exec rspec -c
|
72
|
+
|
73
|
+
It is possible to run only integration and regression tests but exclude unit and stress tests:
|
74
|
+
|
75
|
+
CI=true bundle exec rspec -c spec/higher_level_api/ spec/lower_level_api spec/issues && bundle exec rspec -c spec/higher_level_api/integration/connection_recovery_spec.rb
|
10
76
|
|
11
77
|
## Pull Requests
|
12
78
|
|
data/ChangeLog.md
CHANGED
@@ -1,4 +1,13 @@
|
|
1
|
-
## Changes between Bunny 2.3.0 and 2.
|
1
|
+
## Changes between Bunny 2.3.0 and 2.4.0 (unreleased)
|
2
|
+
|
3
|
+
### Unconfirmed Delivery Tag Set Reset on Network Recovery
|
4
|
+
|
5
|
+
Channels will now reset their unconfirmed delivery tag set after
|
6
|
+
recovery.
|
7
|
+
|
8
|
+
GitHub issue: [#406](https://github.com/ruby-amqp/bunny/pull/406)
|
9
|
+
|
10
|
+
Contributed by Bill Ruddock.
|
2
11
|
|
3
12
|
### Support (Quoted) IPv6 Addresses in Address Lists
|
4
13
|
|
@@ -15,6 +24,22 @@ GitHub issue: [#359](https://github.com/ruby-amqp/bunny/issues/359)
|
|
15
24
|
|
16
25
|
Contributed by Donal McBreen.
|
17
26
|
|
27
|
+
### Client-Provided Session `:properties` Merged with Defaults
|
28
|
+
|
29
|
+
Client-Provided Session `:properties` will now be merged with defaults
|
30
|
+
instead of replacing them. This makes it much more convenient to
|
31
|
+
override a single key.
|
32
|
+
|
33
|
+
### More Predictable RABBITMQ_URL Handling
|
34
|
+
|
35
|
+
`RABBITMQ_URL` no longer will be used if any other
|
36
|
+
connection options are provided. This makes it possible
|
37
|
+
to use `RABBITMQ_URL` for some connections and options
|
38
|
+
for others in a single OS process.
|
39
|
+
|
40
|
+
GitHub issue: [#403](https://github.com/ruby-amqp/bunny/pull/403)
|
41
|
+
|
42
|
+
Contributed by Jimmy Petersen.
|
18
43
|
|
19
44
|
|
20
45
|
## Changes between Bunny 2.2.0 and 2.3.0 (Feb 26th, 2016)
|
@@ -25,6 +50,8 @@ Contributed by Donal McBreen.
|
|
25
50
|
when set to `true`, makes consumer work pool threads to have
|
26
51
|
`Thread#abort_on_exception` set on them.
|
27
52
|
|
53
|
+
GH issue: [#382](https://github.com/ruby-amqp/bunny/pull/382)
|
54
|
+
|
28
55
|
Contributed by Seamus Abshere.
|
29
56
|
|
30
57
|
### Explicit Transport Closure on Recovery
|
data/README.md
CHANGED
@@ -48,7 +48,7 @@ Specific examples:
|
|
48
48
|
|
49
49
|
Modern Bunny versions support
|
50
50
|
|
51
|
-
* CRuby 2.
|
51
|
+
* CRuby 2.0 through 2.3
|
52
52
|
|
53
53
|
Bunny works sufficiently well on JRuby but there are known
|
54
54
|
JRuby bugs in versions prior to JRuby 9000 that cause high CPU burn. JRuby users should
|
@@ -88,7 +88,7 @@ gem install bunny
|
|
88
88
|
To use Bunny in a project managed with Bundler:
|
89
89
|
|
90
90
|
``` ruby
|
91
|
-
gem "bunny", ">= 2.
|
91
|
+
gem "bunny", ">= 2.3.1"
|
92
92
|
```
|
93
93
|
|
94
94
|
|
@@ -183,36 +183,6 @@ try to explain what behavior you expected and why. Bonus points for
|
|
183
183
|
contributing failing test cases.
|
184
184
|
|
185
185
|
|
186
|
-
### Running the Specs
|
187
|
-
|
188
|
-
The specs require RabbitMQ to be running locally with a specific set of vhosts
|
189
|
-
and users. RabbitMQ can be provisioned and started any that's convenient to you
|
190
|
-
as long as it has a suitable TLS keys configuration and management plugin enabled.
|
191
|
-
Make sure you have a recent version of RabbitMQ (> `3.5.3`).
|
192
|
-
|
193
|
-
You can also start a clean RabbitMQ server
|
194
|
-
node on your machine specifically for the bunny specs.
|
195
|
-
To do so, run the following command
|
196
|
-
from the base directory of the gem:
|
197
|
-
|
198
|
-
```
|
199
|
-
RABBITMQ_NODENAME=bunny RABBITMQ_CONFIG_FILE=./spec/config/rabbitmq RABBITMQ_ENABLED_PLUGINS_FILE=./spec/config/enabled_plugins rabbitmq-server
|
200
|
-
```
|
201
|
-
|
202
|
-
The specs use the RabbitMQ management plugin and require a TLS port to be available. The config files in the spec/config directory enable these.
|
203
|
-
|
204
|
-
Next up you'll need to prepare your node for the specs (just once):
|
205
|
-
|
206
|
-
```
|
207
|
-
RABBITMQ_NODENAME=bunny ./bin/ci/before_build
|
208
|
-
```
|
209
|
-
|
210
|
-
And then run the core integration suite:
|
211
|
-
|
212
|
-
```
|
213
|
-
RABBITMQ_NODENAME=bunny CI=true rspec
|
214
|
-
```
|
215
|
-
|
216
186
|
## Other Ruby RabbitMQ Clients
|
217
187
|
|
218
188
|
The other widely used Ruby RabbitMQ client is [March Hare](http://rubymarchhare.info) (JRuby-only).
|
@@ -221,22 +191,8 @@ It's a mature library that require RabbitMQ 3.3.x or later.
|
|
221
191
|
|
222
192
|
## Contributing
|
223
193
|
|
224
|
-
|
225
|
-
|
226
|
-
bundle install --binstubs
|
227
|
-
|
228
|
-
then set up RabbitMQ vhosts with
|
229
|
-
|
230
|
-
./bin/ci/before_build
|
231
|
-
|
232
|
-
(if needed, set `RABBITMQCTL` env variable to point to `rabbitmqctl` you want to use)
|
233
|
-
|
234
|
-
and then run tests with
|
235
|
-
|
236
|
-
CI=true ./bin/rspec -cf documentation spec
|
237
|
-
|
238
|
-
After that create a branch and make your changes on it. Once you are done with your changes and all tests pass, submit a pull request
|
239
|
-
on GitHub.
|
194
|
+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information
|
195
|
+
about running various test suites.
|
240
196
|
|
241
197
|
|
242
198
|
## License
|
data/Rakefile
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
RSpec::Core::RakeTask.new(:integration) do |t|
|
5
|
+
# excludes unit tests as those involve many iterations
|
6
|
+
# and sometimes suffer from obscure interference from integration tests (!)
|
7
|
+
t.pattern = ["spec/higher_level_api/integration", "spec/lower_level_api/integration", "spec/issues", "spec/stress"].
|
8
|
+
map { |dir| Dir.glob(File.join(dir, "**", "*_spec.rb")) }.reduce(&:+) - ["spec/higher_level_api/integration/tls_connection_spec.rb"]
|
9
|
+
|
10
|
+
t.rspec_opts = "--format progress"
|
11
|
+
end
|
12
|
+
|
13
|
+
RSpec::Core::RakeTask.new(:unit) do |t|
|
14
|
+
t.pattern = Dir.glob("spec/unit/**/*_spec.rb")
|
15
|
+
|
16
|
+
t.rspec_opts = "--format progress --backtrace"
|
17
|
+
end
|
18
|
+
|
19
|
+
RSpec::Core::RakeTask.new(:recovery_integration) do |t|
|
20
|
+
# otherwise all examples will be skipped
|
21
|
+
ENV.delete("CI")
|
22
|
+
t.pattern = Dir.glob("spec/higher_level_api/integration/connection_recovery_spec.rb")
|
23
|
+
|
24
|
+
t.rspec_opts = "--format progress --backtrace"
|
25
|
+
end
|
26
|
+
|
27
|
+
task :default => :integration
|
data/docker/Dockerfile
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
FROM debian:jessie
|
2
|
+
|
3
|
+
RUN apt-get -q update && \
|
4
|
+
apt-get install -yq --no-install-recommends wget ca-certificates
|
5
|
+
|
6
|
+
RUN echo 'deb http://www.rabbitmq.com/debian/ testing main' > /etc/apt/sources.list.d/rabbitmq.list && \
|
7
|
+
wget -O- https://www.rabbitmq.com/rabbitmq-signing-key-public.asc | apt-key add -
|
8
|
+
|
9
|
+
RUN apt-get -q update && \
|
10
|
+
apt-get install -yq --no-install-recommends rabbitmq-server
|
11
|
+
|
12
|
+
COPY docker-entrypoint.sh /
|
13
|
+
|
14
|
+
ENTRYPOINT /docker-entrypoint.sh
|
@@ -0,0 +1,40 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
server=rabbitmq-server
|
3
|
+
ctl=rabbitmqctl
|
4
|
+
plugins=rabbitmq-plugins
|
5
|
+
delay=3
|
6
|
+
|
7
|
+
echo '[Configuration] Starting RabbitMQ in detached mode.'
|
8
|
+
|
9
|
+
$server -detached
|
10
|
+
|
11
|
+
echo "[Configuration] Waiting $delay seconds for RabbitMQ to start."
|
12
|
+
|
13
|
+
sleep $delay
|
14
|
+
|
15
|
+
echo '*** Enabling plugins ***'
|
16
|
+
$plugins enable --online rabbitmq_management
|
17
|
+
$plugins enable --online rabbitmq_consistent_hash_exchange
|
18
|
+
|
19
|
+
echo '*** Creating users ***'
|
20
|
+
$ctl add_user bunny_gem bunny_password
|
21
|
+
$ctl add_user bunny_reader reader_password
|
22
|
+
|
23
|
+
echo '*** Creating virtual hosts ***'
|
24
|
+
$ctl add_vhost bunny_testbed
|
25
|
+
|
26
|
+
echo '*** Setting virtual host permissions ***'
|
27
|
+
$ctl set_permissions -p / guest '.*' '.*' '.*'
|
28
|
+
$ctl set_permissions -p bunny_testbed bunny_gem '.*' '.*' '.*'
|
29
|
+
$ctl set_permissions -p bunny_testbed guest '.*' '.*' '.*'
|
30
|
+
$ctl set_permissions -p bunny_testbed bunny_reader '^---$' '^---$' '.*'
|
31
|
+
|
32
|
+
$ctl stop
|
33
|
+
|
34
|
+
echo "[Configuration] Waiting $delay seconds for RabbitMQ to stop."
|
35
|
+
|
36
|
+
sleep $delay
|
37
|
+
|
38
|
+
echo 'Starting RabbitMQ in foreground (CTRL-C to exit)'
|
39
|
+
|
40
|
+
exec $server
|
data/lib/bunny.rb
CHANGED
@@ -58,7 +58,7 @@ module Bunny
|
|
58
58
|
# @see http://rubybunny.info/articles/getting_started.html
|
59
59
|
# @see http://rubybunny.info/articles/connecting.html
|
60
60
|
# @api public
|
61
|
-
def self.new(connection_string_or_opts =
|
61
|
+
def self.new(connection_string_or_opts = ENV['RABBITMQ_URL'], opts = {}, &block)
|
62
62
|
if connection_string_or_opts.respond_to?(:keys) && opts.empty?
|
63
63
|
opts = connection_string_or_opts
|
64
64
|
end
|
@@ -70,7 +70,7 @@ module Bunny
|
|
70
70
|
end
|
71
71
|
|
72
72
|
|
73
|
-
def self.run(connection_string_or_opts =
|
73
|
+
def self.run(connection_string_or_opts = ENV['RABBITMQ_URL'], opts = {}, &block)
|
74
74
|
raise ArgumentError, 'Bunny#run requires a block' unless block
|
75
75
|
|
76
76
|
client = Session.new(connection_string_or_opts, opts)
|
data/lib/bunny/channel.rb
CHANGED
@@ -366,7 +366,7 @@ module Bunny
|
|
366
366
|
# @see http://rubybunny.info/articles/exchanges.html Exchanges and Publishing guide
|
367
367
|
# @api public
|
368
368
|
def default_exchange
|
369
|
-
|
369
|
+
Exchange.default(self)
|
370
370
|
end
|
371
371
|
|
372
372
|
# Declares a headers exchange or looks it up in the cache of previously
|
@@ -427,26 +427,6 @@ module Bunny
|
|
427
427
|
|
428
428
|
# @group QoS and Flow Control
|
429
429
|
|
430
|
-
# Sets how many messages will be given to consumers on this channel before they
|
431
|
-
# have to acknowledge or reject one of the previously consumed messages
|
432
|
-
#
|
433
|
-
# @param [Integer] prefetch_count Prefetch (QoS setting) for this channel
|
434
|
-
# @param [Boolean] global
|
435
|
-
# Whether to use global mode for prefetch:
|
436
|
-
# - +false+: per-consumer
|
437
|
-
# - +true+: per-channel
|
438
|
-
# Note that the default value (+false+) hasn't actually changed, but
|
439
|
-
# previous documentation described that as meaning per-channel and
|
440
|
-
# unsupported in RabbitMQ, whereas it now actually appears to mean
|
441
|
-
# per-consumer and supported
|
442
|
-
# (https://www.rabbitmq.com/consumer-prefetch.html).
|
443
|
-
# @see http://rubybunny.info/articles/exchanges.html Exchanges and Publishing guide
|
444
|
-
# @see http://rubybunny.info/articles/queues.html Queues and Consumers guide
|
445
|
-
# @api public
|
446
|
-
def prefetch(count, global = false)
|
447
|
-
self.basic_qos(count, global)
|
448
|
-
end
|
449
|
-
|
450
430
|
# Flow control. When set to false, RabbitMQ will stop delivering messages on this
|
451
431
|
# channel.
|
452
432
|
#
|
@@ -649,8 +629,8 @@ module Bunny
|
|
649
629
|
# @see http://rubybunny.info/articles/queues.html Queues and Consumers guide
|
650
630
|
# @api public
|
651
631
|
def basic_qos(count, global = false)
|
652
|
-
raise ArgumentError.new("prefetch count must be a positive integer, given: #{
|
653
|
-
raise ArgumentError.new("prefetch count must be no greater than #{MAX_PREFETCH_COUNT}, given: #{
|
632
|
+
raise ArgumentError.new("prefetch count must be a positive integer, given: #{count}") if count < 0
|
633
|
+
raise ArgumentError.new("prefetch count must be no greater than #{MAX_PREFETCH_COUNT}, given: #{count}") if count > MAX_PREFETCH_COUNT
|
654
634
|
raise_if_no_longer_open!
|
655
635
|
|
656
636
|
@connection.send_frame(AMQ::Protocol::Basic::Qos.encode(@id, 0, count, global))
|
@@ -665,6 +645,7 @@ module Bunny
|
|
665
645
|
|
666
646
|
@last_basic_qos_ok
|
667
647
|
end
|
648
|
+
alias prefetch basic_qos
|
668
649
|
|
669
650
|
# Redeliver unacknowledged messages
|
670
651
|
#
|
@@ -1514,6 +1495,7 @@ module Bunny
|
|
1514
1495
|
# @api plugin
|
1515
1496
|
def recover_confirm_mode
|
1516
1497
|
if using_publisher_confirmations?
|
1498
|
+
@unconfirmed_set.clear
|
1517
1499
|
@delivery_tag_offset = @next_publish_seq_no - 1
|
1518
1500
|
confirm_select(@confirms_callback)
|
1519
1501
|
end
|
data/lib/bunny/queue.rb
CHANGED
data/lib/bunny/reader_loop.rb
CHANGED
@@ -92,11 +92,11 @@ module Bunny
|
|
92
92
|
end
|
93
93
|
|
94
94
|
def stopped?
|
95
|
-
@mutex.synchronize { @stopped
|
95
|
+
@mutex.synchronize { @stopped }
|
96
96
|
end
|
97
97
|
|
98
98
|
def stopping?
|
99
|
-
@mutex.synchronize { @stopping
|
99
|
+
@mutex.synchronize { @stopping }
|
100
100
|
end
|
101
101
|
|
102
102
|
def terminate_with(e)
|
data/lib/bunny/session.rb
CHANGED
@@ -125,12 +125,12 @@ module Bunny
|
|
125
125
|
# @see http://rubybunny.info/articles/connecting.html Connecting to RabbitMQ guide
|
126
126
|
# @see http://rubybunny.info/articles/tls.html TLS/SSL guide
|
127
127
|
# @api public
|
128
|
-
def initialize(connection_string_or_opts =
|
129
|
-
opts = case (
|
128
|
+
def initialize(connection_string_or_opts = ENV['RABBITMQ_URL'], optz = Hash.new)
|
129
|
+
opts = case (connection_string_or_opts)
|
130
130
|
when nil then
|
131
131
|
Hash.new
|
132
132
|
when String then
|
133
|
-
self.class.parse_uri(
|
133
|
+
self.class.parse_uri(connection_string_or_opts)
|
134
134
|
when Hash then
|
135
135
|
connection_string_or_opts
|
136
136
|
end.merge(optz)
|
@@ -179,7 +179,7 @@ module Bunny
|
|
179
179
|
@channel_max = @client_channel_max
|
180
180
|
@client_heartbeat = self.heartbeat_from(opts)
|
181
181
|
|
182
|
-
@client_properties = opts
|
182
|
+
@client_properties = DEFAULT_CLIENT_PROPERTIES.merge(opts.fetch(:properties, {}))
|
183
183
|
@mechanism = opts.fetch(:auth_mechanism, "PLAIN")
|
184
184
|
@credentials_encoder = credentials_encoder_for(@mechanism)
|
185
185
|
@locale = @opts.fetch(:locale, DEFAULT_LOCALE)
|
data/lib/bunny/version.rb
CHANGED
@@ -36,7 +36,10 @@ describe Bunny::Channel, "#prefetch" do
|
|
36
36
|
ch = connection.create_channel
|
37
37
|
expect {
|
38
38
|
ch.prefetch(100_000)
|
39
|
-
}.to raise_error(
|
39
|
+
}.to raise_error(
|
40
|
+
ArgumentError,
|
41
|
+
"prefetch count must be no greater than #{Bunny::Channel::MAX_PREFETCH_COUNT}, given: 100000"
|
42
|
+
)
|
40
43
|
end
|
41
44
|
end
|
42
45
|
|
@@ -45,7 +48,10 @@ describe Bunny::Channel, "#prefetch" do
|
|
45
48
|
ch = connection.create_channel
|
46
49
|
expect {
|
47
50
|
ch.prefetch(-2)
|
48
|
-
}.to raise_error(
|
51
|
+
}.to raise_error(
|
52
|
+
ArgumentError,
|
53
|
+
"prefetch count must be a positive integer, given: -2"
|
54
|
+
)
|
49
55
|
end
|
50
56
|
end
|
51
57
|
end
|
@@ -5,7 +5,7 @@ unless ENV["CI"]
|
|
5
5
|
describe "Concurrent consumers sharing a connection" do
|
6
6
|
before :all do
|
7
7
|
@connection = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed",
|
8
|
-
:automatic_recovery => false
|
8
|
+
:automatic_recovery => false)
|
9
9
|
@connection.start
|
10
10
|
end
|
11
11
|
|
@@ -21,12 +21,13 @@ unless ENV["CI"]
|
|
21
21
|
let(:colors) { ["red", "blue", "white"] }
|
22
22
|
|
23
23
|
let(:n) { 32 }
|
24
|
-
let(:m) {
|
24
|
+
let(:m) { 5000 }
|
25
25
|
|
26
26
|
it "successfully drain all queues" do
|
27
|
-
|
27
|
+
ch0 = @connection.create_channel
|
28
|
+
ch0.confirm_select
|
28
29
|
body = "абвг"
|
29
|
-
x =
|
30
|
+
x = ch0.topic("bunny.stress.concurrent.consumers.topic", :durable => true)
|
30
31
|
|
31
32
|
chs = {}
|
32
33
|
n.times do |i|
|
@@ -54,14 +55,16 @@ unless ENV["CI"]
|
|
54
55
|
x.publish(body, :routing_key => colors.sample)
|
55
56
|
end
|
56
57
|
puts "Published #{(i + 1) * m} messages..."
|
58
|
+
ch0.wait_for_confirms
|
57
59
|
end
|
58
60
|
|
59
61
|
while any_not_drained?(qs)
|
60
62
|
sleep 1.0
|
61
63
|
end
|
62
|
-
puts "Drained all
|
64
|
+
puts "Drained all queues, winding down..."
|
63
65
|
|
64
|
-
|
66
|
+
ch0.close
|
67
|
+
chs.each { |_, ch| ch.close }
|
65
68
|
end
|
66
69
|
end
|
67
70
|
end
|
@@ -4,7 +4,7 @@ require "spec_helper"
|
|
4
4
|
unless ENV["CI"]
|
5
5
|
describe "Concurrent publishers sharing a connection" do
|
6
6
|
before :all do
|
7
|
-
@connection = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :automatically_recover => false
|
7
|
+
@connection = Bunny.new(:user => "bunny_gem", :password => "bunny_password", :vhost => "bunny_testbed", :automatically_recover => false)
|
8
8
|
@connection.start
|
9
9
|
end
|
10
10
|
|
@@ -16,17 +16,13 @@ unless ENV["CI"]
|
|
16
16
|
let(:rate) { 5_000 }
|
17
17
|
|
18
18
|
it "successfully finish publishing" do
|
19
|
-
ch = @connection.create_channel
|
20
|
-
|
21
|
-
q = ch.queue("", :exclusive => true)
|
22
19
|
body = "сообщение"
|
23
20
|
|
24
|
-
# let the queue name be sent back by RabbitMQ
|
25
|
-
sleep 0.25
|
26
|
-
|
27
21
|
chs = {}
|
28
22
|
concurrency.times do |i|
|
29
|
-
|
23
|
+
ch = @connection.create_channel
|
24
|
+
ch.confirm_select
|
25
|
+
chs[i] = ch
|
30
26
|
end
|
31
27
|
|
32
28
|
ts = []
|
@@ -34,14 +30,13 @@ unless ENV["CI"]
|
|
34
30
|
concurrency.times do |i|
|
35
31
|
t = Thread.new do
|
36
32
|
cht = chs[i]
|
37
|
-
x =
|
33
|
+
x = cht.default_exchange
|
38
34
|
|
39
|
-
|
40
|
-
|
41
|
-
x.publish(body, :routing_key => q.name)
|
42
|
-
end
|
43
|
-
puts "Published #{(i + 1) * rate} messages..."
|
35
|
+
rate.times do
|
36
|
+
x.publish(body)
|
44
37
|
end
|
38
|
+
puts "Published #{rate} messages..."
|
39
|
+
cht.wait_for_confirms
|
45
40
|
end
|
46
41
|
t.abort_on_exception = true
|
47
42
|
|
@@ -51,6 +46,8 @@ unless ENV["CI"]
|
|
51
46
|
ts.each do |t|
|
52
47
|
t.join
|
53
48
|
end
|
49
|
+
|
50
|
+
chs.each { |_, ch| ch.close }
|
54
51
|
end
|
55
52
|
end
|
56
53
|
end
|
@@ -0,0 +1,131 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
unless ENV["CI"]
|
4
|
+
describe "Publisher with wait_for_confirms suffering a lost connection" do
|
5
|
+
before :all do
|
6
|
+
@connection = Bunny.new(
|
7
|
+
:user => "bunny_gem",
|
8
|
+
:password => "bunny_password",
|
9
|
+
:vhost => "bunny_testbed",
|
10
|
+
:recover_from_connection_close => true,
|
11
|
+
:network_recovery_interval => 0.2,
|
12
|
+
:recovery_attempts => 3,
|
13
|
+
:continuation_timeout => 3_000)
|
14
|
+
@connection.start
|
15
|
+
end
|
16
|
+
|
17
|
+
after :all do
|
18
|
+
@connection.close
|
19
|
+
end
|
20
|
+
|
21
|
+
let(:rate) { 50 }
|
22
|
+
let(:inner_rate) { 5 }
|
23
|
+
let(:max_retries) { 3 }
|
24
|
+
let(:routing_key) { 'confirms' }
|
25
|
+
|
26
|
+
let(:http_client) { RabbitMQ::HTTP::Client.new('http://127.0.0.1:15672') }
|
27
|
+
|
28
|
+
let!(:ch_pub) { @connection.create_channel.tap { |ch| ch.confirm_select } }
|
29
|
+
let!(:ch_sub) { @connection.create_channel }
|
30
|
+
let!(:topic) { 'bunny.stress.concurrent.confirms.topic' }
|
31
|
+
let!(:x) { ch_pub.topic(topic, :durable => true) }
|
32
|
+
let!(:q) do
|
33
|
+
ch_sub.queue('', :durable => true).tap do |q|
|
34
|
+
q.bind(x.name, :routing_key => routing_key)
|
35
|
+
q.purge
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
def close_all_connections!
|
40
|
+
http_client.list_connections.each do |conn_info|
|
41
|
+
begin
|
42
|
+
http_client.close_connection(conn_info.name)
|
43
|
+
rescue Bunny::ConnectionForced => e
|
44
|
+
# This is not a problem, but the specs intermittently believe it is.
|
45
|
+
printf "Rescued forced connection: #{e.inspect}\n"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def wait_for_recovery
|
51
|
+
sleep 1.5
|
52
|
+
end
|
53
|
+
|
54
|
+
after do
|
55
|
+
unless ch_sub.closed?
|
56
|
+
q.delete
|
57
|
+
ch_sub.close
|
58
|
+
end
|
59
|
+
ch_pub.close unless ch_pub.closed?
|
60
|
+
end
|
61
|
+
|
62
|
+
it "successfully publish and consume all messages" do
|
63
|
+
begin
|
64
|
+
subscriber_mutex = Mutex.new
|
65
|
+
ids_received = Set.new
|
66
|
+
message_count = nil
|
67
|
+
|
68
|
+
sub = Thread.new do
|
69
|
+
begin
|
70
|
+
q.subscribe do |delivery_info, meta, payload|
|
71
|
+
subscriber_mutex.synchronize do
|
72
|
+
ids_received << payload.to_i
|
73
|
+
message_count = q.message_count
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
78
|
+
sub.abort_on_exception = true
|
79
|
+
|
80
|
+
pub = Thread.new do
|
81
|
+
rate.times do |i|
|
82
|
+
retries = 0
|
83
|
+
begin
|
84
|
+
inner_rate.times do |j|
|
85
|
+
id = i * inner_rate + j
|
86
|
+
x.publish(id.to_s, :routing_key => routing_key)
|
87
|
+
end
|
88
|
+
until ch_pub.unconfirmed_set.empty?
|
89
|
+
unless ch_pub.wait_for_confirms
|
90
|
+
raise "Not all messages acknowledged, nacks: #{ch_pub.nacked_set.inspect}"
|
91
|
+
end
|
92
|
+
end
|
93
|
+
rescue => e
|
94
|
+
puts "Rescued error in iteration #{i}: #{e.inspect}"
|
95
|
+
retries += 1
|
96
|
+
raise if retries > max_retries
|
97
|
+
|
98
|
+
puts "sleeping before retry #{retries}"
|
99
|
+
sleep 0.5
|
100
|
+
retry
|
101
|
+
end
|
102
|
+
end
|
103
|
+
puts "Published #{rate * inner_rate} messages..."
|
104
|
+
end
|
105
|
+
pub.abort_on_exception = true
|
106
|
+
sleep 0.2 while ids_received.size < 10
|
107
|
+
|
108
|
+
close_all_connections!
|
109
|
+
wait_for_recovery
|
110
|
+
|
111
|
+
pub.join
|
112
|
+
|
113
|
+
sleep 0.1 until message_count == 0
|
114
|
+
puts "Drained queue, winding down..."
|
115
|
+
|
116
|
+
q.delete
|
117
|
+
ch_pub.close
|
118
|
+
ch_sub.close
|
119
|
+
sub.kill
|
120
|
+
|
121
|
+
expect(ch_pub.unconfirmed_set).to be_empty
|
122
|
+
|
123
|
+
expected_ids = Set.new((rate * inner_rate).times)
|
124
|
+
missing_ids = expected_ids - ids_received
|
125
|
+
expect(missing_ids).to eq(Set.new)
|
126
|
+
ensure
|
127
|
+
sub.kill
|
128
|
+
end
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
data/spec/tls/ca_certificate.pem
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
2
|
+
MIIC7jCCAdagAwIBAgIJAPo+qW/K5mHrMA0GCSqGSIb3DQEBCwUAMCcxFTATBgNV
|
3
|
+
BAMMDE15VGVzdFJvb3RDQTEOMAwGA1UEBwwFOTEzNDMwHhcNMTYwMjI5MTA0NDA3
|
4
|
+
WhcNMjYwMjI2MTA0NDA3WjAnMRUwEwYDVQQDDAxNeVRlc3RSb290Q0ExDjAMBgNV
|
5
|
+
BAcMBTkxMzQzMIIBIjANBgkqhkiG9w0BAQE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Zd0ZlF8vKg4ybJ6T/45Aai2gK82bRKyyExyPnbJSsI9vhklPJuMt8ZmvBW
|
23
|
+
HBTQ/DUYOpVMWPtlHJ4a9xlZVCJNd96uQB8rEecQp3fGP02/r4Mp2Lrhim3u/uyW
|
24
|
+
WJmA+gECgYBNncMDorlUeWVSuq/zud/d97UEAvNSkDtlg/TVQrtRYDlCM2J9lH3J
|
25
|
+
UpkcbZeDJpLs4sC+edJ5IJpGwczn4j1nu8LUzy8DhjKFz0pKTJCNc48KfO0ayWwh
|
26
|
+
HUm0G9JSiL+F7IgUE3nabTmtH9QJdhHOslqOwLO4VgvcZdJufj2JPg==
|
27
27
|
-----END RSA PRIVATE KEY-----
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Duncan
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2016-
|
15
|
+
date: 2016-06-11 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: amq-protocol
|
@@ -46,6 +46,7 @@ files:
|
|
46
46
|
- Gemfile
|
47
47
|
- LICENSE
|
48
48
|
- README.md
|
49
|
+
- Rakefile
|
49
50
|
- benchmarks/basic_publish/with_128K_messages.rb
|
50
51
|
- benchmarks/basic_publish/with_1k_messages.rb
|
51
52
|
- benchmarks/basic_publish/with_4K_messages.rb
|
@@ -58,7 +59,10 @@ files:
|
|
58
59
|
- benchmarks/synchronized_sorted_set.rb
|
59
60
|
- benchmarks/write_vs_write_nonblock.rb
|
60
61
|
- bin/ci/before_build
|
62
|
+
- bin/ci/start_rabbitmq
|
61
63
|
- bunny.gemspec
|
64
|
+
- docker/Dockerfile
|
65
|
+
- docker/docker-entrypoint.sh
|
62
66
|
- examples/connection/authentication_failure.rb
|
63
67
|
- examples/connection/automatic_recovery_with_basic_get.rb
|
64
68
|
- examples/connection/automatic_recovery_with_client_named_queues.rb
|
@@ -193,13 +197,11 @@ files:
|
|
193
197
|
- spec/stress/concurrent_publishers_stress_spec.rb
|
194
198
|
- spec/stress/connection_open_close_spec.rb
|
195
199
|
- spec/stress/long_running_consumer_spec.rb
|
200
|
+
- spec/stress/wait_for_confirms_with_connection_loss_stress_spec.rb
|
196
201
|
- spec/tls/ca_certificate.pem
|
197
202
|
- spec/tls/ca_key.pem
|
198
|
-
- spec/tls/cacert.pem
|
199
|
-
- spec/tls/client_cert.pem
|
200
203
|
- spec/tls/client_certificate.pem
|
201
204
|
- spec/tls/client_key.pem
|
202
|
-
- spec/tls/server_cert.pem
|
203
205
|
- spec/tls/server_certificate.pem
|
204
206
|
- spec/tls/server_key.pem
|
205
207
|
- spec/unit/bunny_spec.rb
|
@@ -228,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
230
|
version: '0'
|
229
231
|
requirements: []
|
230
232
|
rubyforge_project:
|
231
|
-
rubygems_version: 2.
|
233
|
+
rubygems_version: 2.4.8
|
232
234
|
signing_key:
|
233
235
|
specification_version: 4
|
234
236
|
summary: Popular easy to use Ruby client for RabbitMQ
|
@@ -295,13 +297,11 @@ test_files:
|
|
295
297
|
- spec/stress/concurrent_publishers_stress_spec.rb
|
296
298
|
- spec/stress/connection_open_close_spec.rb
|
297
299
|
- spec/stress/long_running_consumer_spec.rb
|
300
|
+
- spec/stress/wait_for_confirms_with_connection_loss_stress_spec.rb
|
298
301
|
- spec/tls/ca_certificate.pem
|
299
302
|
- spec/tls/ca_key.pem
|
300
|
-
- spec/tls/cacert.pem
|
301
|
-
- spec/tls/client_cert.pem
|
302
303
|
- spec/tls/client_certificate.pem
|
303
304
|
- spec/tls/client_key.pem
|
304
|
-
- spec/tls/server_cert.pem
|
305
305
|
- spec/tls/server_certificate.pem
|
306
306
|
- spec/tls/server_key.pem
|
307
307
|
- spec/unit/bunny_spec.rb
|
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+ZT5GetzoqulKxt/f1u
|
9
|
-
0K/gVnMUvFmflR4hsx5qBNV6wFEYwMfi+C6q184aJv7jmjumimf9IBOcOkZrDnQD
|
10
|
-
+7HeOeZAbMgLtCaacD2SH72s3hIHvgetbIJva+zJkbjjjA+Ycd824WjG+CiOEIch
|
11
|
-
AgMBAAGjHTAbMAwGA1UdEwQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEB
|
12
|
-
BQUAA4IBAQAvLziFQ56+vNyNAGDD8bQaUY8JElXj4X3vC0nFeN0zuPQz9Aa8UH4A
|
13
|
-
Y7e/j3NS2mfYdqC8U3iYEXZwp4qk4/JZ9SkhRiaLbeIF7VT+xg+K/HDmBmwNZpQL
|
14
|
-
b9bNBk9BeRMv4jJUuM/BE04nm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