bunny 1.7.0 → 2.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +5 -5
  2. data/.github/ISSUE_TEMPLATE.md +18 -0
  3. data/.gitignore +6 -1
  4. data/.rspec +1 -3
  5. data/.travis.yml +21 -14
  6. data/CONTRIBUTING.md +132 -0
  7. data/ChangeLog.md +745 -1
  8. data/Gemfile +13 -13
  9. data/LICENSE +1 -1
  10. data/README.md +41 -75
  11. data/Rakefile +54 -0
  12. data/bunny.gemspec +4 -10
  13. data/docker-compose.yml +28 -0
  14. data/docker/Dockerfile +24 -0
  15. data/docker/apt/preferences.d/erlang +3 -0
  16. data/docker/apt/sources.list.d/bintray.rabbitmq.list +2 -0
  17. data/docker/docker-entrypoint.sh +26 -0
  18. data/docker/rabbitmq.conf +29 -0
  19. data/examples/connection/automatic_recovery_with_basic_get.rb +1 -1
  20. data/examples/connection/automatic_recovery_with_client_named_queues.rb +1 -1
  21. data/examples/connection/automatic_recovery_with_multiple_consumers.rb +1 -1
  22. data/examples/connection/automatic_recovery_with_republishing.rb +1 -1
  23. data/examples/connection/automatic_recovery_with_server_named_queues.rb +1 -1
  24. data/examples/connection/channel_level_exception.rb +1 -9
  25. data/examples/connection/disabled_automatic_recovery.rb +1 -1
  26. data/examples/connection/heartbeat.rb +1 -1
  27. data/examples/consumers/high_and_low_priority.rb +1 -1
  28. data/examples/guides/extensions/alternate_exchange.rb +2 -0
  29. data/examples/guides/getting_started/hello_world.rb +2 -0
  30. data/examples/guides/getting_started/weathr.rb +2 -0
  31. data/examples/guides/queues/one_off_consumer.rb +2 -0
  32. data/examples/guides/queues/redeliveries.rb +2 -0
  33. data/lib/bunny.rb +6 -2
  34. data/lib/bunny/channel.rb +192 -109
  35. data/lib/bunny/channel_id_allocator.rb +6 -4
  36. data/lib/bunny/concurrent/continuation_queue.rb +34 -13
  37. data/lib/bunny/consumer_work_pool.rb +34 -6
  38. data/lib/bunny/cruby/socket.rb +29 -16
  39. data/lib/bunny/cruby/ssl_socket.rb +20 -7
  40. data/lib/bunny/exceptions.rb +7 -1
  41. data/lib/bunny/exchange.rb +11 -7
  42. data/lib/bunny/get_response.rb +1 -1
  43. data/lib/bunny/heartbeat_sender.rb +3 -2
  44. data/lib/bunny/jruby/socket.rb +23 -6
  45. data/lib/bunny/jruby/ssl_socket.rb +5 -0
  46. data/lib/bunny/queue.rb +12 -10
  47. data/lib/bunny/reader_loop.rb +31 -18
  48. data/lib/bunny/session.rb +389 -134
  49. data/lib/bunny/test_kit.rb +14 -0
  50. data/lib/bunny/timeout.rb +1 -12
  51. data/lib/bunny/transport.rb +114 -67
  52. data/lib/bunny/version.rb +1 -1
  53. data/repl +1 -1
  54. data/spec/config/rabbitmq.conf +13 -0
  55. data/spec/higher_level_api/integration/basic_ack_spec.rb +154 -22
  56. data/spec/higher_level_api/integration/basic_cancel_spec.rb +77 -11
  57. data/spec/higher_level_api/integration/basic_consume_spec.rb +60 -55
  58. data/spec/higher_level_api/integration/basic_consume_with_objects_spec.rb +6 -6
  59. data/spec/higher_level_api/integration/basic_get_spec.rb +31 -7
  60. data/spec/higher_level_api/integration/basic_nack_spec.rb +22 -19
  61. data/spec/higher_level_api/integration/basic_publish_spec.rb +11 -100
  62. data/spec/higher_level_api/integration/basic_qos_spec.rb +32 -4
  63. data/spec/higher_level_api/integration/basic_reject_spec.rb +94 -16
  64. data/spec/higher_level_api/integration/basic_return_spec.rb +4 -4
  65. data/spec/higher_level_api/integration/channel_close_spec.rb +51 -10
  66. data/spec/higher_level_api/integration/channel_open_spec.rb +12 -12
  67. data/spec/higher_level_api/integration/connection_recovery_spec.rb +412 -286
  68. data/spec/higher_level_api/integration/connection_spec.rb +284 -134
  69. data/spec/higher_level_api/integration/connection_stop_spec.rb +31 -19
  70. data/spec/higher_level_api/integration/consumer_cancellation_notification_spec.rb +17 -17
  71. data/spec/higher_level_api/integration/dead_lettering_spec.rb +14 -14
  72. data/spec/higher_level_api/integration/exchange_bind_spec.rb +5 -5
  73. data/spec/higher_level_api/integration/exchange_declare_spec.rb +32 -31
  74. data/spec/higher_level_api/integration/exchange_delete_spec.rb +12 -12
  75. data/spec/higher_level_api/integration/exchange_unbind_spec.rb +5 -5
  76. data/spec/higher_level_api/integration/exclusive_queue_spec.rb +5 -5
  77. data/spec/higher_level_api/integration/heartbeat_spec.rb +4 -4
  78. data/spec/higher_level_api/integration/message_properties_access_spec.rb +49 -49
  79. data/spec/higher_level_api/integration/predeclared_exchanges_spec.rb +2 -2
  80. data/spec/higher_level_api/integration/publisher_confirms_spec.rb +92 -27
  81. data/spec/higher_level_api/integration/publishing_edge_cases_spec.rb +19 -19
  82. data/spec/higher_level_api/integration/queue_bind_spec.rb +23 -23
  83. data/spec/higher_level_api/integration/queue_declare_spec.rb +129 -34
  84. data/spec/higher_level_api/integration/queue_delete_spec.rb +2 -2
  85. data/spec/higher_level_api/integration/queue_purge_spec.rb +5 -5
  86. data/spec/higher_level_api/integration/queue_unbind_spec.rb +6 -6
  87. data/spec/higher_level_api/integration/read_only_consumer_spec.rb +9 -9
  88. data/spec/higher_level_api/integration/sender_selected_distribution_spec.rb +10 -10
  89. data/spec/higher_level_api/integration/tls_connection_spec.rb +218 -112
  90. data/spec/higher_level_api/integration/toxiproxy_spec.rb +76 -0
  91. data/spec/higher_level_api/integration/tx_commit_spec.rb +1 -1
  92. data/spec/higher_level_api/integration/tx_rollback_spec.rb +1 -1
  93. data/spec/higher_level_api/integration/with_channel_spec.rb +2 -2
  94. data/spec/issues/issue100_spec.rb +11 -12
  95. data/spec/issues/issue141_spec.rb +13 -14
  96. data/spec/issues/issue202_spec.rb +1 -1
  97. data/spec/issues/issue224_spec.rb +5 -5
  98. data/spec/issues/issue465_spec.rb +32 -0
  99. data/spec/issues/issue549_spec.rb +30 -0
  100. data/spec/issues/issue78_spec.rb +21 -24
  101. data/spec/issues/issue83_spec.rb +5 -6
  102. data/spec/issues/issue97_spec.rb +44 -45
  103. data/spec/lower_level_api/integration/basic_cancel_spec.rb +15 -16
  104. data/spec/lower_level_api/integration/basic_consume_spec.rb +20 -21
  105. data/spec/spec_helper.rb +2 -19
  106. data/spec/stress/channel_close_stress_spec.rb +3 -3
  107. data/spec/stress/channel_open_stress_spec.rb +4 -4
  108. data/spec/stress/channel_open_stress_with_single_threaded_connection_spec.rb +7 -7
  109. data/spec/stress/concurrent_consumers_stress_spec.rb +18 -16
  110. data/spec/stress/concurrent_publishers_stress_spec.rb +16 -19
  111. data/spec/stress/connection_open_close_spec.rb +9 -9
  112. data/spec/stress/merry_go_round_spec.rb +105 -0
  113. data/spec/tls/ca_certificate.pem +27 -16
  114. data/spec/tls/ca_key.pem +52 -27
  115. data/spec/tls/client_certificate.pem +27 -16
  116. data/spec/tls/client_key.pem +49 -25
  117. data/spec/tls/generate-server-cert.sh +8 -0
  118. data/spec/tls/server-openssl.cnf +10 -0
  119. data/spec/tls/server.csr +16 -0
  120. data/spec/tls/server_certificate.pem +27 -16
  121. data/spec/tls/server_key.pem +49 -25
  122. data/spec/toxiproxy_helper.rb +28 -0
  123. data/spec/unit/bunny_spec.rb +5 -5
  124. data/spec/unit/concurrent/atomic_fixnum_spec.rb +6 -6
  125. data/spec/unit/concurrent/condition_spec.rb +8 -8
  126. data/spec/unit/concurrent/linked_continuation_queue_spec.rb +2 -2
  127. data/spec/unit/concurrent/synchronized_sorted_set_spec.rb +16 -16
  128. data/spec/unit/exchange_recovery_spec.rb +39 -0
  129. data/spec/unit/version_delivery_tag_spec.rb +3 -3
  130. metadata +42 -35
  131. data/lib/bunny/system_timer.rb +0 -20
  132. data/spec/config/rabbitmq.config +0 -18
  133. data/spec/higher_level_api/integration/basic_recover_spec.rb +0 -18
  134. data/spec/higher_level_api/integration/confirm_select_spec.rb +0 -19
  135. data/spec/higher_level_api/integration/consistent_hash_exchange_spec.rb +0 -50
  136. data/spec/higher_level_api/integration/merry_go_round_spec.rb +0 -85
  137. data/spec/stress/long_running_consumer_spec.rb +0 -83
  138. data/spec/tls/cacert.pem +0 -18
  139. data/spec/tls/client_cert.pem +0 -18
  140. data/spec/tls/server_cert.pem +0 -18
  141. data/spec/unit/system_timer_spec.rb +0 -10
data/Gemfile CHANGED
@@ -11,7 +11,7 @@ extend Module.new {
11
11
 
12
12
  local_path = File.expand_path("../vendor/#{name}", __FILE__)
13
13
  if File.exist?(local_path)
14
- super name, options.merge(:path => local_path).
14
+ super name, options.merge(path: local_path).
15
15
  delete_if { |key, _| [:git, :branch].include?(key) }
16
16
  else
17
17
  super name, *args
@@ -19,23 +19,23 @@ extend Module.new {
19
19
  end
20
20
  }
21
21
 
22
- gem "SystemTimer", "~> 1.2.3", :platform => :ruby_18
23
-
24
- gem "rake", ">= 10.0.4"
25
- gem "effin_utf8"
22
+ gem "rake", ">= 12.3.1"
26
23
 
27
24
  group :development do
28
25
  gem "yard"
29
26
 
30
- gem "redcarpet", :platform => :mri
31
- gem "ruby-prof", :platform => :mri
27
+ gem "redcarpet", platform: :mri
28
+ gem "ruby-prof", platform: :mri
32
29
 
33
- gem "json", :platform => :ruby_18
30
+ gem "ripl"
31
+ gem "ripl-multi_line"
32
+ gem "ripl-irb"
34
33
  end
35
34
 
36
35
  group :test do
37
- gem "rspec", "~> 2.13.0"
38
- gem "rabbitmq_http_api_client", "~> 1.2.0"
36
+ gem "rspec", "~> 3.9.0"
37
+ gem "rabbitmq_http_api_client", "~> 1.13.0", require: "rabbitmq/http/client"
38
+ gem "toxiproxy", "~> 1.0.3"
39
39
  end
40
40
 
41
41
  gemspec
@@ -45,11 +45,11 @@ gemspec
45
45
  def custom_gem(name, options = Hash.new)
46
46
  local_path = File.expand_path("../vendor/#{name}", __FILE__)
47
47
  if File.exist?(local_path)
48
- # puts "Using #{name} from #{local_path}..."
49
- gem name, options.merge(:path => local_path).delete_if { |key, _| [:git, :branch].include?(key) }
48
+ puts "Using #{name} from #{local_path}..."
49
+ gem name, options.merge(path: local_path).delete_if { |key, _| [:git, :branch].include?(key) }
50
50
  else
51
51
  gem name, options
52
52
  end
53
53
  end
54
54
 
55
- custom_gem "amq-protocol", :git => "git://github.com/ruby-amqp/amq-protocol.git", :branch => "master"
55
+ custom_gem "amq-protocol", git: "https://github.com/ruby-amqp/amq-protocol", branch: "master"
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 2014 Chris Duncan, Jakub Stastny aka botanicus,
1
+ Copyright (c) 2009–2019 Chris Duncan, Jakub Stastny aka botanicus,
2
2
  Michael S. Klishin, Eric Lindvall, Stefan Kaes and contributors.
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
data/README.md CHANGED
@@ -12,8 +12,8 @@ have any heavyweight dependencies.
12
12
 
13
13
  ## What is Bunny Good For?
14
14
 
15
- One can use amqp gem to make Ruby applications interoperate with other
16
- applications (both Ruby and not). Complexity and size may vary from
15
+ One can use Bunny to make Ruby applications interoperate with other
16
+ applications (both built in Ruby and not). Complexity and size may vary from
17
17
  simple work queues to complex multi-stage data processing workflows that involve
18
18
  many applications built with all kinds of technologies.
19
19
 
@@ -43,44 +43,45 @@ Specific examples:
43
43
  Web applications that display that information in the real time.
44
44
 
45
45
 
46
-
47
46
  ## Supported Ruby Versions
48
47
 
49
- Bunny 0.9 and more recent versions support
48
+ Modern Bunny versions support
50
49
 
51
- * CRuby 2.1, CRuby 2.0, 1.9.3, 1.9.2, and 1.8.7
52
- * Rubinius 2.0+
50
+ * CRuby 2.3 through 2.7 (inclusive)
53
51
 
54
52
  Bunny works sufficiently well on JRuby but there are known
55
- JRuby bugs that cause high CPU burn. JRuby users should
53
+ JRuby bugs in versions prior to JRuby 9000 that cause high CPU burn. JRuby users should
56
54
  use [March Hare](http://rubymarchhare.info).
57
55
 
56
+ Bunny `1.7.x` was the last version to support CRuby 1.9.3 and 1.8.7
57
+
58
58
 
59
59
  ## Supported RabbitMQ Versions
60
60
 
61
- Bunny `1.5.0` (including previews) and later versions only support RabbitMQ `3.3+`.
62
- Bunny `1.4.x` and supports RabbitMQ 2.x and 3.x.
61
+ Bunny `1.5.0` and later versions only support RabbitMQ `3.3+`.
62
+ Bunny `1.4.x` and earlier supports RabbitMQ 2.x and 3.x.
63
63
 
64
64
 
65
- ## Project Maturity
65
+ ## Change Log
66
66
 
67
67
  Bunny is a mature library (started in early 2009) with
68
68
  a stable public API.
69
69
 
70
- Before version 0.9, **a lot** of functionality was missing. Version
71
- 0.9 can be considered to be a "second birthday" for Bunny as it was
72
- rewritten from scratch with over a dozen of preview releases over the
73
- course of about a year.
70
+ Change logs per release series:
71
+
72
+ * [master](https://github.com/ruby-amqp/bunny/blob/master/ChangeLog.md)
73
+ * [2.16.x](https://github.com/ruby-amqp/bunny/blob/2.16.x-stable/ChangeLog.md)
74
+ * [2.15.x](https://github.com/ruby-amqp/bunny/blob/2.15.x-stable/ChangeLog.md)
75
+ * [2.14.x](https://github.com/ruby-amqp/bunny/blob/2.14.x-stable/ChangeLog.md)
76
+ * [2.13.x](https://github.com/ruby-amqp/bunny/blob/2.13.x-stable/ChangeLog.md)
74
77
 
75
- We (the maintainers) made our best effort to keep the new version as
76
- backwards compatible as possible but within reason.
77
78
 
78
79
 
79
80
  ## Installation & Bundler Dependency
80
81
 
81
82
  ### Most Recent Release
82
83
 
83
- [![Gem Version](https://badge.fury.io/rb/bunny.png)](http://badge.fury.io/rb/bunny)
84
+ [![Gem Version](https://badge.fury.io/rb/bunny.svg)](http://badge.fury.io/rb/bunny)
84
85
 
85
86
  ### With Rubygems
86
87
 
@@ -95,7 +96,7 @@ gem install bunny
95
96
  To use Bunny in a project managed with Bundler:
96
97
 
97
98
  ``` ruby
98
- gem "bunny", "~> 1.4.0"
99
+ gem "bunny", ">= 2.16.1"
99
100
  ```
100
101
 
101
102
 
@@ -161,88 +162,53 @@ Other documentation guides are available at [rubybunny.info](http://rubybunny.in
161
162
 
162
163
  ### Mailing List
163
164
 
164
- [Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). We encourage you
165
- to also join the [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users) mailing list. Feel free to ask any questions that you may have.
165
+ [Bunny has a mailing list](http://groups.google.com/group/ruby-amqp). Please use it for all questions,
166
+ investigations, and discussions. GitHub issues should be used for specific, well understood, actionable
167
+ maintainers and contributors can work on.
166
168
 
169
+ We encourage you to also join the [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users)
170
+ mailing list. Feel free to ask any questions that you may have.
167
171
 
168
- ### IRC
169
172
 
170
- For more immediate help, please join `#rabbitmq` on `irc.freenode.net`.
173
+ ## Continuous Integration
174
+
175
+ [![Build Status](https://travis-ci.org/ruby-amqp/bunny.svg)](https://travis-ci.org/ruby-amqp/bunny/)
171
176
 
172
177
 
173
178
  ### News & Announcements on Twitter
174
179
 
175
180
  To subscribe for announcements of releases, important changes and so on, please follow [@rubyamqp](https://twitter.com/#!/rubyamqp) on Twitter.
176
181
 
177
- More detailed announcements can be found in the blogs
178
-
179
- * [RabbitMQ Ruby clients blog](http://blog.rubyrabbitmq.info)
180
- * [Bunny Blog](http://bunnyamqp.wordpress.com)
182
+ More detailed announcements can be found in the [RabbitMQ Ruby clients blog](http://blog.rubyrabbitmq.info).
181
183
 
182
184
 
183
185
  ### Reporting Issues
184
186
 
185
- If you find a bug, poor default, missing feature or find any part of
186
- the API inconvenient, please [file an
187
- issue](http://github.com/ruby-amqp/bunny/issues) on GitHub. When
188
- filing an issue, please specify which Bunny and RabbitMQ versions you
189
- are using, provide recent RabbitMQ log file contents if possible, and
190
- try to explain what behavior you expected and why. Bonus points for
191
- contributing failing test cases.
192
-
193
-
194
- ### Running the specs
195
-
196
- The cleanest way to get the specs running is by starting a clean rabbitmq server
197
- node on your machine specifically for the bunny specs.
198
-
199
- Make sure you have a recent version of RabbitMQ (> 3.2) and run the following command
200
- from the base directory of the gem:
201
-
202
- `RABBITMQ_NODENAME=bunny RABBITMQ_CONFIG_FILE=./spec/config/rabbitmq RABBITMQ_ENABLED_PLUGINS_FILE=./spec/config/enabled_plugins rabbitmq-server`
203
-
204
- > The specs use the Rabbitmq management plugin and require an SSL port to be available. The config files in the spec/config directory enable these. Please note that this config uses verify_none because the certificates are expired.
187
+ If you find a bug you understand well, poor default, incorrect or unclear piece of documentation,
188
+ or missing feature, please [file an
189
+ issue](http://github.com/ruby-amqp/bunny/issues) on GitHub.
205
190
 
206
- Next up you'll need to prepare your node for the specs (Only once):
191
+ Please use [Bunny's mailing list](http://groups.google.com/group/ruby-amqp) for questions,
192
+ investigations, and discussions. GitHub issues should be used for specific, well understood, actionable
193
+ maintainers and contributors can work on.
207
194
 
208
- `RABBITMQ_NODENAME=bunny ./bin/ci/before_build.sh`
195
+ When filing an issue, please specify which Bunny and RabbitMQ versions you
196
+ are using, provide recent RabbitMQ log file contents, full exception stack traces,
197
+ and steps to reproduce (or failing test cases).
209
198
 
210
- And then run the specs:
211
-
212
- `RABBITMQ_NODENAME=bunny rspec`
213
199
 
214
200
  ## Other Ruby RabbitMQ Clients
215
201
 
216
- Other widely used Ruby RabbitMQ clients are [March
217
- Hare](http://rubymarchhare.info) (JRuby-only) and [amqp
218
- gem](http://rubyamqp.info). Both are mature libraries and require
219
- RabbitMQ 2.x or 3.x.
202
+ The other widely used Ruby RabbitMQ client is [March Hare](http://rubymarchhare.info) (JRuby-only).
203
+ It's a mature library that require RabbitMQ 3.3.x or later.
220
204
 
221
205
 
222
206
  ## Contributing
223
207
 
224
- First, clone the repository and run
225
-
226
- bundle install --binstubs
227
-
228
- then set up RabbitMQ vhosts with
229
-
230
- ./bin/ci/before_build.sh
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 -cfs 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.
208
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) for more information
209
+ about running various test suites.
240
210
 
241
211
 
242
212
  ## License
243
213
 
244
214
  Released under the MIT license.
245
-
246
-
247
- [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/ruby-amqp/bunny/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
248
-
@@ -0,0 +1,54 @@
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"].
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(:integration_without_recovery) do |t|
14
+ # same as :integration but excludes client connection recovery tests.
15
+ # useful for sanity checking edge RabbitMQ builds, for instance.
16
+ t.pattern = ["spec/higher_level_api/integration", "spec/lower_level_api/integration", "spec/issues"].
17
+ map { |dir| Dir.glob(File.join(dir, "**", "*_spec.rb")) }.reduce(&:+) -
18
+ ["spec/higher_level_api/integration/tls_connection_spec.rb",
19
+ "spec/higher_level_api/integration/connection_recovery_spec.rb"]
20
+
21
+ t.rspec_opts = "--format progress"
22
+ end
23
+
24
+ RSpec::Core::RakeTask.new(:unit) do |t|
25
+ t.pattern = Dir.glob("spec/unit/**/*_spec.rb")
26
+
27
+ t.rspec_opts = "--format progress --backtrace"
28
+ end
29
+
30
+ RSpec::Core::RakeTask.new(:recovery_integration) do |t|
31
+ # otherwise all examples will be skipped
32
+ ENV.delete("CI")
33
+ t.pattern = ["spec/higher_level_api/integration/connection_recovery_spec.rb"]
34
+
35
+ t.rspec_opts = "--format progress --backtrace"
36
+ end
37
+
38
+ RSpec::Core::RakeTask.new(:stress) do |t|
39
+ # excludes unit tests as those involve many iterations
40
+ # and sometimes suffer from obscure interference from integration tests (!)
41
+ t.pattern = ["spec/stress/**/*_spec.rb"]
42
+
43
+ t.rspec_opts = "--format progress"
44
+ end
45
+
46
+ task :default => :integration
47
+
48
+ namespace :tls do
49
+ desc "Checks the certificates and keys in BUNNY_CERTIFICATE_DIR with openssl s_client"
50
+ task :s_client do
51
+ dir = ENV["BUNNY_CERTIFICATE_DIR"]
52
+ sh "openssl s_client -tls1_2 -connect 127.0.0.1:5671 -cert #{dir}/client_certificate.pem -key #{dir}/client_key.pem -CAfile #{dir}/ca_certificate.pem"
53
+ end
54
+ end
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = "Popular easy to use Ruby client for RabbitMQ"
12
12
  s.description = "Easy to use, feature complete Ruby client for RabbitMQ 3.3 and later versions."
13
13
  s.license = "MIT"
14
+ s.required_ruby_version = Gem::Requirement.new(">= 2.2")
14
15
 
15
16
  # Sorted alphabetically.
16
17
  s.authors = [
@@ -20,21 +21,14 @@ Gem::Specification.new do |s|
20
21
  "Michael S. Klishin",
21
22
  "Stefan Kaes"]
22
23
 
23
- s.email = [
24
- "Y2VsbGRlZUBnbWFpbC5jb20=\n",
25
- "ZXJpY0A1c3RvcHMuY29t\n",
26
- "c3Rhc3RueUAxMDFpZGVhcy5jeg==\n",
27
- "bWljaGFlbEBub3ZlbWJlcmFpbi5jb20=\n",
28
- "c2thZXNAcmFpbHNleHByZXNzLmRl\n"].
29
- map { |mail| Base64.decode64(mail) }
24
+ s.email = ["michael.s.klishin@gmail.com"]
30
25
 
31
26
  # Dependencies
32
- s.add_dependency "amq-protocol", ">= 1.9.2"
27
+ s.add_runtime_dependency 'amq-protocol', '~> 2.3', '>= 2.3.1'
33
28
 
34
29
  # Files.
35
- s.has_rdoc = true
36
30
  s.extra_rdoc_files = ["README.md"]
37
- s.files = `git ls-files`.split("\n")
31
+ s.files = `git ls-files`.split("\n").reject { |f| f.match(%r{^bin/ci/}) }
38
32
  s.test_files = `git ls-files -- spec/*`.split("\n")
39
33
  s.require_paths = ["lib"]
40
34
  end
@@ -0,0 +1,28 @@
1
+ version: '3.7'
2
+ services:
3
+ rabbitmq:
4
+ build: ./docker
5
+ container_name: bunny_rabbitmq
6
+ environment:
7
+ RABBITMQ_NODENAME: bunny
8
+ # see CONTRIBUTING.md
9
+ BUNNY_RABBITMQ_HOSTNAME: mercurio
10
+ # link to spec specific configuration
11
+ RABBITMQ_CONFIG_FILE: /spec/config/rabbitmq.conf
12
+ RABBITMQ_ENABLED_PLUGINS_FILE: /spec/config/enabled_plugins
13
+ # send logs to stdout
14
+ RABBITMQ_LOGS: '-'
15
+ RABBITMQ_SASL_LOGS: '-'
16
+ ports:
17
+ - 5671-5672:5671-5672
18
+ - 15672:15672
19
+ volumes:
20
+ - ./spec:/spec:ro
21
+ toxiproxy:
22
+ container_name: toxiproxy
23
+ image: shopify/toxiproxy
24
+ ports:
25
+ - 8474:8474
26
+ - 11111:11111
27
+ depends_on:
28
+ - rabbitmq
@@ -0,0 +1,24 @@
1
+ FROM ubuntu:18.04
2
+
3
+ RUN apt-get update -y
4
+ RUN apt-get install -y gnupg2 wget
5
+ RUN wget -O - "https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc" | apt-key add -
6
+
7
+ COPY apt/sources.list.d/bintray.rabbitmq.list /etc/apt/sources.list.d/bintray.rabbitmq.list
8
+ COPY apt/preferences.d/erlang /etc/apt/preferences.d/erlang
9
+
10
+ RUN apt-get update -y && apt-get upgrade -y
11
+
12
+ RUN apt-get install -y erlang-base \
13
+ erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
14
+ erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
15
+ erlang-runtime-tools erlang-snmp erlang-ssl \
16
+ erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
17
+
18
+ RUN apt-get install -y rabbitmq-server
19
+
20
+ COPY docker-entrypoint.sh /
21
+
22
+ ENTRYPOINT /docker-entrypoint.sh
23
+
24
+ EXPOSE 5671 5672 15672
@@ -0,0 +1,3 @@
1
+ Package: erlang*
2
+ Pin: release o=Bintray
3
+ Pin-Priority: 1000
@@ -0,0 +1,2 @@
1
+ deb http://dl.bintray.com/rabbitmq-erlang/debian bionic erlang
2
+ deb http://dl.bintray.com/rabbitmq/debian bionic main
@@ -0,0 +1,26 @@
1
+ #!/bin/sh
2
+ server=rabbitmq-server
3
+ ctl=rabbitmqctl
4
+ delay=5
5
+
6
+ echo 'Starting a RabbitMQ node'
7
+ $server -detached
8
+
9
+ echo "Waiting for RabbitMQ to finish startup..."
10
+
11
+ $ctl await_startup --timeout 15
12
+
13
+ $ctl add_user bunny_gem bunny_password
14
+ $ctl add_user bunny_reader reader_password
15
+
16
+ $ctl add_vhost bunny_testbed
17
+
18
+ $ctl set_permissions -p / guest '.*' '.*' '.*'
19
+ $ctl set_permissions -p bunny_testbed bunny_gem '.*' '.*' '.*'
20
+ $ctl set_permissions -p bunny_testbed guest '.*' '.*' '.*'
21
+ $ctl set_permissions -p bunny_testbed bunny_reader '^---$' '^---$' '.*'
22
+
23
+ $ctl shutdown --timeout 10
24
+
25
+ echo 'Starting a RabbitMQ node in foreground (use Ctrl-C to stop)'
26
+ exec $server
@@ -0,0 +1,29 @@
1
+ listeners.tcp.1 = 0.0.0.0:5672
2
+
3
+ listeners.ssl.default = 5671
4
+
5
+ ssl_options.cacertfile = /spec/tls/ca_certificate.pem
6
+ ssl_options.certfile = /spec/tls/server_certificate.pem
7
+ ssl_options.keyfile = /spec/tls/server_key.pem
8
+ ssl_options.verify = verify_none
9
+ ssl_options.fail_if_no_peer_cert = false
10
+
11
+ ssl_options.honor_cipher_order = true
12
+ ssl_options.honor_ecc_order = true
13
+ ssl_options.client_renegotiation = false
14
+ ssl_options.secure_renegotiate = true
15
+
16
+ ssl_options.ciphers.1 = ECDHE-ECDSA-AES256-GCM-SHA384
17
+ ssl_options.ciphers.2 = ECDHE-RSA-AES256-GCM-SHA384
18
+ ssl_options.ciphers.3 = ECDH-ECDSA-AES256-GCM-SHA384
19
+ ssl_options.ciphers.4 = ECDH-RSA-AES256-GCM-SHA384
20
+ ssl_options.ciphers.5 = DHE-RSA-AES256-GCM-SHA384
21
+ ssl_options.ciphers.6 = DHE-DSS-AES256-GCM-SHA384
22
+ ssl_options.ciphers.7 = ECDHE-ECDSA-AES128-GCM-SHA256
23
+ ssl_options.ciphers.8 = ECDHE-RSA-AES128-GCM-SHA256
24
+ ssl_options.ciphers.9 = ECDH-ECDSA-AES128-GCM-SHA256
25
+ ssl_options.ciphers.10 = ECDH-RSA-AES128-GCM-SHA256
26
+ ssl_options.ciphers.11 = DHE-RSA-AES128-GCM-SHA256
27
+ ssl_options.ciphers.12 = DHE-DSS-AES128-GCM-SHA256
28
+
29
+ loopback_users = none