amqp 0.8.0 → 0.8.1

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.
@@ -17,4 +17,5 @@ notifications:
17
17
  branches:
18
18
  only:
19
19
  - master
20
+ - 0.8.x-stable
20
21
  - 0.7.x-stable
data/CHANGELOG CHANGED
@@ -1,3 +1,7 @@
1
+ = Version 0.8.1 (not yet released)
2
+
3
+ * [API] AMQP::Channel#reuse allows channel instance to be reused with a different channel id, may be used to recover from channel-level exceptions.
4
+
1
5
  = Version 0.8.0
2
6
 
3
7
  * [API] AMQP::Session#on_skipped_heartbeats callback that can be used to handle skipped heartbeats (for cases when TCP network failure detection is not timely enough)
data/README.md CHANGED
@@ -71,11 +71,11 @@ with are outdated even in recent (10.10) releases. Learn more in the [RabbitMQ v
71
71
  On Microsoft Windows 7
72
72
 
73
73
  gem install eventmachine --pre
74
- gem install amqp --pre
74
+ gem install amqp
75
75
 
76
76
  On other OSes or [JRuby](http://jruby.org):
77
77
 
78
- gem install amqp --pre
78
+ gem install amqp
79
79
 
80
80
 
81
81
  ### "Hello, World" example ###
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  # Dependencies
25
25
  s.add_dependency "eventmachine"
26
26
  s.add_dependency "amq-client", "~> 0.8.3"
27
- s.add_dependency "amq-protocol", "~> 0.8.0"
27
+ s.add_dependency "amq-protocol", "~> 0.8.3"
28
28
 
29
29
  begin
30
30
  require "changelog"
@@ -70,13 +70,13 @@ h4. On Microsoft Windows 7:
70
70
 
71
71
  <pre>
72
72
  gem install eventmachine --pre
73
- gem install amqp --pre
73
+ gem install amqp
74
74
  </pre>
75
75
 
76
76
  h4. On other OSes or JRuby:
77
77
 
78
78
  <pre>
79
- gem install amqp --pre
79
+ gem install amqp
80
80
  </pre>
81
81
 
82
82
  h3. You can also use Bundler to install the gem
@@ -85,7 +85,7 @@ h3. You can also use Bundler to install the gem
85
85
  <code>
86
86
  source :rubygems
87
87
 
88
- gem "amqp", "~> 0.8.0.RC15" # optionally: :git => "git://github.com/ruby-amqp/amqp.git", :branch => "master"
88
+ gem "amqp", "~> 0.8.0" # optionally: :git => "git://github.com/ruby-amqp/amqp.git", :branch => "0.8.x-stable"
89
89
  </code>
90
90
  </pre>
91
91
 
@@ -100,7 +100,7 @@ irb -rubygems
100
100
  :001 > require "amqp"
101
101
  => true
102
102
  :002 > AMQP::VERSION
103
- => "0.8.0.rc15"
103
+ => "0.8.0"
104
104
  </code>
105
105
  </pre>
106
106
 
@@ -270,6 +270,25 @@ module AMQP
270
270
  end
271
271
  end # auto_recover
272
272
 
273
+ # Can be used to recover channels from channel-level exceptions. Allocates a new channel id and reopens
274
+ # itself with this new id, releasing the old id after the new one is allocated.
275
+ #
276
+ # @api public
277
+ def reuse
278
+ old_id = @id
279
+ # must release after we allocate a new id, otherwise we will end up
280
+ # with the same value. MK.
281
+ @id = self.class.next_channel_id
282
+ self.class.release_channel_id(old_id)
283
+
284
+ self.open do
285
+ @channel_is_open_deferrable.succeed
286
+
287
+ # exchanges must be recovered first because queue recovery includes recovery of bindings. MK.
288
+ @exchanges.each { |name, e| e.auto_recover }
289
+ @queues.each { |name, q| q.auto_recover }
290
+ end
291
+ end # reuse
273
292
 
274
293
 
275
294
 
@@ -811,7 +811,16 @@ module AMQP
811
811
 
812
812
  shim = Proc.new { |q, declare_ok| block.call(declare_ok.message_count, declare_ok.consumer_count) }
813
813
 
814
- @channel.once_open { self.declare(true, @durable, @exclusive, @auto_delete, false, nil, &shim) }
814
+ @channel.once_open do
815
+ # we do not use self.declare here to avoid caching of @passive since that will cause unexpected side-effects during automatic
816
+ # recovery process. MK.
817
+ @connection.send_frame(AMQ::Protocol::Queue::Declare.encode(@channel.id, @name, true, @opts[:durable], @opts[:exclusive], @opts[:auto_delete], false, @opts[:arguments]))
818
+
819
+ self.append_callback(:declare, &shim)
820
+ @channel.queues_awaiting_declare_ok.push(self)
821
+ end
822
+
823
+ self
815
824
  end
816
825
 
817
826
 
@@ -6,5 +6,5 @@ module AMQP
6
6
  #
7
7
  # @see AMQ::Protocol::VERSION
8
8
  # @return [String] AMQP gem version
9
- VERSION = '0.8.0'
9
+ VERSION = '0.8.1'
10
10
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: amqp
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Aman Gupta
@@ -17,8 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-09-04 00:00:00 +04:00
21
- default_executable:
20
+ date: 2011-10-12 00:00:00 Z
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
24
23
  name: eventmachine
@@ -58,12 +57,12 @@ dependencies:
58
57
  requirements:
59
58
  - - ~>
60
59
  - !ruby/object:Gem::Version
61
- hash: 63
60
+ hash: 57
62
61
  segments:
63
62
  - 0
64
63
  - 8
65
- - 0
66
- version: 0.8.0
64
+ - 3
65
+ version: 0.8.3
67
66
  type: :runtime
68
67
  version_requirements: *id003
69
68
  description: Widely used, feature-rich asynchronous AMQP 0.9.1 client with batteries included.
@@ -329,56 +328,10 @@ files:
329
328
  - spec/unit/amqp/client_spec.rb
330
329
  - spec/unit/amqp/connection_spec.rb
331
330
  - spec/unit/amqp/int_allocator_spec.rb
332
- has_rdoc: true
333
331
  homepage: http://github.com/ruby-amqp/amqp
334
332
  licenses: []
335
333
 
336
- post_install_message: "[\e[32mVersion 0.8.0\e[0m] [API] AMQP::Session#on_skipped_heartbeats callback that can be used to handle skipped heartbeats (for cases when TCP network failure detection is not timely enough)\n\
337
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Exchange#publish calls now use a mutex on the channel exchange is declared on. Sharing channels between threads is discouraged but amqp gem covers your back in the most dangerous case.\n\
338
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Channel#synchronize now can be used to guarantee mutual exclusion of multiple threads on channel instances.\n\
339
- [\e[32mVersion 0.8.0\e[0m] [BUG] Empty messages can finally be published fine. Yes, it took us just 3 years.\n\
340
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] When connected to RabbitMQ, RabbitMQ-specific extensions are required automatically\n\
341
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] AMQP::Session#broker and AMQP::Broker allow for broker capabilities inspection\n\
342
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] New bitset-based channel id allocator\n\
343
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Multiple consumers per queue with AMQP::Consumer\n\
344
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Automatic recovery mode for channels\n\
345
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Network connection recovery callbacks for channels, exchanges, queues, consumers\n\
346
- [\e[32mVersion 0.8.0\e[0m] [API] Connection URI (string) format for vhosts no longer assumes that vhosts begin with a slash (/), learn more at http://bit.ly/mfzwcB\n\
347
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Returned messages, including header & content via AMQP::Exchange#on_publish. Callback accepts 3 args: basic_return, header, body\n\
348
- [\e[32mVersion 0.8.0\e[0m] [BUG] Ruby 1.8.7-p249 is not supported because of this (p249-specific) Ruby bug: http://bit.ly/iONBmH\n\
349
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] AMQP::Utilities::EventLoopHelper detects app server (if any) being used and starts EventMachine reactor in an optimal way.\n\
350
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] AMQP 0.9.1 support, including tx.* operations class.\n\
351
- [\e[32mVersion 0.8.0\e[0m] [API] Default authentication handler now raises AMQP::PossibleAuthenticationFailureError\n\
352
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Channel#initialize now takes 3rd (optional) options hash.\n\
353
- [\e[32mVersion 0.8.0\e[0m] [API] Broker connection class is now AMQP::Session.\n\
354
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Error instance now may carry cause, an exception that caused exception in question to be raised.\n\
355
- [\e[32mVersion 0.8.0\e[0m] [API] When initial TCP connection fails, default action is now to raise AMQP::TCPConnectionFailed.\n\
356
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::BasicClient#reconnect now takes 2nd optional argument, period of waiting in seconds.\n\
357
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Handlers for initial connection failure, connection loss; channel-level exceptions handlers on Channel instances.\n\
358
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Exchange#initialize now accepts :arguments option that takes a hash.\n\
359
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#initialize now accepts :arguments option that takes a hash.\n\
360
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP#Logger is deprecated. It will be removed before 1.0 release.\n\
361
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP#fork is deprecated. It will be removed before 1.0 release.\n\
362
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::RPC is deprecated. It will be removed before 1.0 release.\n\
363
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Significant improvements to the documentation. From now on lack of/poor documentation is considered a severe bug.\n\
364
- [\e[32mVersion 0.8.0\e[0m] [FEATURE] Support for RabbitMQ extensions to AMQP 0.9.1\n\
365
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Exchange#publish now accepts (an optional) callback.\n\
366
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Channel.new now accepts (an optional) callback.\n\
367
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Header#ack now can acknowledge multiple deliveries\n\
368
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Exchange#delete now takes (an optional) block that is called when exchange.delete-ok response arrives.\n\
369
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Header now implements #to_hash\n\
370
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#pop block now can take 1, 2 or 3 arguments.\n\
371
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#purge now takes an optional block which is called when queue.purge-ok response arrives.\n\
372
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#delete now takes an optional block which is called when queue.delete-ok response arrives.\n\
373
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#delete now accepts :nowait option.\n\
374
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#unbind now takes an optional block which is called when queue.unbind-ok response arrives.\n\
375
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#unbind now accepts :routing_key as alias to :key. we believe it is a good idea to use AMQP terms.\n\
376
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Channel#prefetch now takes (an optional) 2nd parameter that specifies that QoS settings should be applied to underlying connection, as well as optional callback.\n\
377
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Channel#recover now takes (an optional) callback that is called when basic.recover-ok is received.\n\
378
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Frame is gone.\n\
379
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Buffer is gone. Serialization & framing are now handled primarily by amq-protocol.\n\
380
- [\e[32mVersion 0.8.0\e[0m] [API] AMQP::Queue#publish is deprecated.\n\
381
- [\e[32mVersion 0.8.0\e[0m] [API] Name argument for AMQP::Queue.new and Channel#queue is optional.\n"
334
+ post_install_message:
382
335
  rdoc_options:
383
336
  - --include=examples --main README.md
384
337
  require_paths:
@@ -404,7 +357,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
404
357
  requirements: []
405
358
 
406
359
  rubyforge_project: amqp
407
- rubygems_version: 1.6.2
360
+ rubygems_version: 1.8.10
408
361
  signing_key:
409
362
  specification_version: 3
410
363
  summary: Widely used, feature-rich asynchronous AMQP 0.9.1 client with batteries included