bunny 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,13 @@
1
+ ## Changes between Bunny 0.9.2 and 0.9.3
2
+
3
+ ### Publishing Over Closed Connections
4
+
5
+ Publishing a message over a closed connection (during a network outage, before the connection
6
+ is open) will now correctly result in an exception.
7
+
8
+ Contributed by Matt Campbell.
9
+
10
+
1
11
  ## Changes between Bunny 0.9.1 and 0.9.2
2
12
 
3
13
  ### Reliability Improvement in Automatic Network Failure Recovery
data/README.md CHANGED
@@ -80,15 +80,15 @@ backwards compatible as possible but within reason.
80
80
  To install Bunny 0.9.x with RubyGems:
81
81
 
82
82
  ```
83
- gem install bunny --pre
83
+ gem install bunny --version ">= 0.9.2"
84
84
  ```
85
85
 
86
- the most recent 0.9.x version is `0.9.0.rc2`.
86
+ the most recent 0.9.x version is `0.9.2`.
87
87
 
88
88
  To use Bunny 0.9.x in a project managed with Bundler:
89
89
 
90
90
  ``` ruby
91
- gem "bunny", ">= 0.9.0.rc2" # optionally: , :git => "git://github.com/ruby-amqp/bunny.git", :branch => "master"
91
+ gem "bunny", ">= 0.9.2"
92
92
  ```
93
93
 
94
94
 
@@ -19,10 +19,16 @@ q.purge
19
19
  q.bind(x, :routing_key => "abc").bind(x, :routing_key => "def")
20
20
 
21
21
  loop do
22
- sleep 1.5
22
+ sleep 8
23
23
  body = rand.to_s
24
- puts "Published #{body}"
25
- x.publish(body, :routing_key => ["abc", "def"].sample)
24
+
25
+ begin
26
+ x.publish(body, :routing_key => ["abc", "def"].sample)
27
+ puts "Published #{body}"
28
+ # happens when a message is published before the connection
29
+ # is recovered
30
+ rescue Exception => e
31
+ end
26
32
 
27
33
  sleep 1.5
28
34
  _, _, payload = q.pop
@@ -26,6 +26,11 @@ loop do
26
26
  data = rand.to_s
27
27
  rk = ["abc", "def"].sample
28
28
 
29
- puts "Published #{data}, routing key: #{rk}"
30
- x.publish(data, :routing_key => rk)
29
+ begin
30
+ x.publish(rand.to_s, :routing_key => rk)
31
+ puts "Published #{data}, routing key: #{rk}"
32
+ # happens when a message is published before the connection
33
+ # is recovered
34
+ rescue Exception => e
35
+ end
31
36
  end
@@ -33,8 +33,14 @@ q2.subscribe do |delivery_info, metadata, payload|
33
33
  end
34
34
 
35
35
  loop do
36
- sleep 3
36
+ sleep 2
37
37
  rk = ["abc", "def", "ghi", "xyz"].sample
38
38
  puts "Publishing with routing key #{rk}"
39
- x1.publish(rand.to_s, :routing_key => rk)
39
+
40
+ begin
41
+ x1.publish(rand.to_s, :routing_key => rk)
42
+ # happens when a message is published before the connection
43
+ # is recovered
44
+ rescue Bunny::ConnectionClosedError => e
45
+ end
40
46
  end
@@ -26,6 +26,10 @@ loop do
26
26
  data = rand.to_s
27
27
  rk = ["abc", "def"].sample
28
28
 
29
- puts "Published #{data}, routing key: #{rk}"
30
- x.publish(data, :routing_key => rk)
29
+ begin
30
+ x.publish(rand.to_s, :routing_key => rk)
31
+ # happens when a message is published before the connection
32
+ # is recovered
33
+ rescue Bunny::ConnectionClosedError => e
34
+ end
31
35
  end
@@ -630,11 +630,11 @@ module Bunny
630
630
  # @raise [ConnectionClosedError]
631
631
  # @private
632
632
  def send_frame(frame, signal_activity = true)
633
- if closed?
634
- raise ConnectionClosedError.new(frame)
635
- else
633
+ if open?
636
634
  @transport.write(frame.encode)
637
635
  signal_activity! if signal_activity
636
+ else
637
+ raise ConnectionClosedError.new(frame)
638
638
  end
639
639
  end
640
640
 
@@ -645,11 +645,11 @@ module Bunny
645
645
  # @raise [ConnectionClosedError]
646
646
  # @private
647
647
  def send_frame_without_timeout(frame, signal_activity = true)
648
- if closed?
649
- raise ConnectionClosedError.new(frame)
650
- else
648
+ if open?
651
649
  @transport.write_without_timeout(frame.encode)
652
650
  signal_activity! if signal_activity
651
+ else
652
+ raise ConnectionClosedError.new(frame)
653
653
  end
654
654
  end
655
655
 
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Bunny
4
4
  # @return [String] Version of the library
5
- VERSION = "0.9.2"
5
+ VERSION = "0.9.3"
6
6
  end
metadata CHANGED
@@ -1,7 +1,8 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
+ prerelease:
5
6
  platform: ruby
6
7
  authors:
7
8
  - Chris Duncan
@@ -12,29 +13,36 @@ authors:
12
13
  autorequire:
13
14
  bindir: bin
14
15
  cert_chain: []
15
- date: 2013-07-20 00:00:00.000000000 Z
16
+ date: 2013-07-24 00:00:00.000000000 Z
16
17
  dependencies:
17
18
  - !ruby/object:Gem::Dependency
18
19
  name: amq-protocol
19
20
  requirement: !ruby/object:Gem::Requirement
21
+ none: false
20
22
  requirements:
21
- - - '>='
23
+ - - ! '>='
22
24
  - !ruby/object:Gem::Version
23
25
  version: 1.6.0
24
26
  type: :runtime
25
27
  prerelease: false
26
28
  version_requirements: !ruby/object:Gem::Requirement
29
+ none: false
27
30
  requirements:
28
- - - '>='
31
+ - - ! '>='
29
32
  - !ruby/object:Gem::Version
30
33
  version: 1.6.0
31
34
  description: Easy to use, feature complete Ruby client for RabbitMQ 2.0.
32
35
  email:
33
- - celldee@gmail.com
34
- - eric@5stops.com
35
- - stastny@101ideas.cz
36
- - michael@novemberain.com
37
- - skaes@railsexpress.de
36
+ - !binary |-
37
+ Y2VsbGRlZUBnbWFpbC5jb20=
38
+ - !binary |-
39
+ ZXJpY0A1c3RvcHMuY29t
40
+ - !binary |-
41
+ c3Rhc3RueUAxMDFpZGVhcy5jeg==
42
+ - !binary |-
43
+ bWljaGFlbEBub3ZlbWJlcmFpbi5jb20=
44
+ - !binary |-
45
+ c2thZXNAcmFpbHNleHByZXNzLmRl
38
46
  executables: []
39
47
  extensions: []
40
48
  extra_rdoc_files:
@@ -184,26 +192,27 @@ files:
184
192
  homepage: http://rubybunny.info
185
193
  licenses:
186
194
  - MIT
187
- metadata: {}
188
195
  post_install_message:
189
196
  rdoc_options: []
190
197
  require_paths:
191
198
  - lib
192
199
  required_ruby_version: !ruby/object:Gem::Requirement
200
+ none: false
193
201
  requirements:
194
- - - '>='
202
+ - - ! '>='
195
203
  - !ruby/object:Gem::Version
196
204
  version: '0'
197
205
  required_rubygems_version: !ruby/object:Gem::Requirement
206
+ none: false
198
207
  requirements:
199
- - - '>='
208
+ - - ! '>='
200
209
  - !ruby/object:Gem::Version
201
210
  version: '0'
202
211
  requirements: []
203
212
  rubyforge_project:
204
- rubygems_version: 2.0.5
213
+ rubygems_version: 1.8.25
205
214
  signing_key:
206
- specification_version: 4
215
+ specification_version: 3
207
216
  summary: Popular easy to use Ruby client for RabbitMQ
208
217
  test_files:
209
218
  - spec/compatibility/queue_declare_spec.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: deafec372105c91a09a6d8b591586e30e4249130
4
- data.tar.gz: a1cd14563b4cae9f215b0e0281ef593e671c874c
5
- SHA512:
6
- metadata.gz: 1c6aeff5a3446e1e183ea85eb665d710a583c69c9f0c63bb6eb0fd88799efc996d106cf594bd7daec645bc81c29f2f2fe7ac7c5788399d8191969813d2a52595
7
- data.tar.gz: d951ff5afc82912a0aecf6076d8268c1ff14ec7e9a6ecc08cb0d40e5726edffcc7326a7fe73cc56c12b6169dedb9184cd0c2345d5ce823cd7879cb6cfa90488a