right_amqp 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -0
- data/Rakefile +24 -11
- data/lib/right_amqp/amqp/client.rb +4 -1
- data/lib/right_amqp/ha_client/broker_client.rb +4 -4
- data/right_amqp.gemspec +2 -2
- data/spec/ha_client/broker_client_spec.rb +12 -0
- data/spec/spec_helper.rb +2 -1
- metadata +24 -8
data/README.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -25,12 +25,20 @@ require 'rubygems'
|
|
25
25
|
require 'bundler/setup'
|
26
26
|
|
27
27
|
require 'rake'
|
28
|
-
require 'rdoc/task'
|
29
28
|
require 'rubygems/package_task'
|
30
29
|
require 'rake/clean'
|
31
30
|
require 'rspec/core/rake_task'
|
32
31
|
require 'bacon'
|
33
32
|
|
33
|
+
# These dependencies can be omitted using "bundle install --without"; tolerate their absence.
|
34
|
+
['rdoc/task'].each do |optional|
|
35
|
+
begin
|
36
|
+
require optional
|
37
|
+
rescue LoadError
|
38
|
+
# ignore
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
34
42
|
desc "Run unit tests"
|
35
43
|
task :default => 'spec'
|
36
44
|
|
@@ -52,19 +60,24 @@ namespace :spec do
|
|
52
60
|
end
|
53
61
|
end
|
54
62
|
|
55
|
-
|
56
|
-
|
57
|
-
rdoc
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
63
|
+
if defined?(Rake::RDocTask)
|
64
|
+
desc 'Generate documentation for the right_amqp gem'
|
65
|
+
Rake::RDocTask.new(:rdoc) do |rdoc|
|
66
|
+
rdoc.rdoc_dir = 'doc/rdocs'
|
67
|
+
rdoc.title = 'RightAMQP'
|
68
|
+
rdoc.options << '--line-numbers' << '--inline-source'
|
69
|
+
rdoc.rdoc_files.include('README.rdoc')
|
70
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
71
|
+
end
|
62
72
|
end
|
63
73
|
CLEAN.include('doc/rdocs')
|
64
74
|
|
65
75
|
desc "Build right_amqp gem"
|
66
|
-
Gem::PackageTask.new(Gem::Specification.load("right_amqp.gemspec")) do |
|
67
|
-
|
68
|
-
|
76
|
+
Gem::PackageTask.new(Gem::Specification.load("right_amqp.gemspec")) do |pkg|
|
77
|
+
pkg.need_zip = true
|
78
|
+
pkg.need_tar = true
|
69
79
|
end
|
70
80
|
CLEAN.include('pkg')
|
81
|
+
|
82
|
+
require 'right_develop'
|
83
|
+
RightDevelop::CI::RakeTask.new
|
@@ -26,8 +26,11 @@ module AMQP
|
|
26
26
|
'en_US')
|
27
27
|
|
28
28
|
when Protocol::Connection::Tune
|
29
|
+
# Use frame_max received from broker so that adapt properly to RabbitMQ 2.4.1
|
30
|
+
# expecting 131,072 and RabbitMQ 3.4.1 that is configured to 0 meaning unlimited
|
31
|
+
# because it will otherwise reject requests larger than this and fail the connection
|
29
32
|
send Protocol::Connection::TuneOk.new(:channel_max => 0,
|
30
|
-
:frame_max =>
|
33
|
+
:frame_max => method.frame_max,
|
31
34
|
:heartbeat => @settings[:heartbeat] || 0)
|
32
35
|
|
33
36
|
send Protocol::Connection::Open.new(:virtual_host => @settings[:vhost],
|
@@ -99,7 +99,7 @@ module RightAMQP
|
|
99
99
|
# :prefetch(Integer):: Maximum number of messages the AMQP broker is to prefetch for the agent
|
100
100
|
# before it receives an ack. Value 1 ensures that only last unacknowledged gets redelivered
|
101
101
|
# if the agent crashes. Value 0 means unlimited prefetch.
|
102
|
-
# :fiber_pool(
|
102
|
+
# :fiber_pool(FiberPool):: Pool of initialized fibers to be used for asynchronous message
|
103
103
|
# processing (can be overridden with subscribe option)
|
104
104
|
# :exception_on_receive_callback(Proc):: Callback activated on a receive exception with parameters
|
105
105
|
# message(Object):: Message received
|
@@ -216,7 +216,7 @@ module RightAMQP
|
|
216
216
|
# :no_log(Boolean):: Disable receive logging unless debug level
|
217
217
|
# :exchange2(Hash):: Additional exchange to which same queue is to be bound
|
218
218
|
# :brokers(Array):: Identity of brokers for which to subscribe, defaults to all usable if nil or empty
|
219
|
-
# :fiber_pool(
|
219
|
+
# :fiber_pool(FiberPool):: Pool of initialized fibers to be used for asynchronous message
|
220
220
|
# processing (non-nil value will override constructor option setting)
|
221
221
|
#
|
222
222
|
# === Block
|
@@ -416,7 +416,7 @@ module RightAMQP
|
|
416
416
|
false
|
417
417
|
end
|
418
418
|
end
|
419
|
-
|
419
|
+
|
420
420
|
# Delete queue
|
421
421
|
#
|
422
422
|
# === Parameters
|
@@ -438,7 +438,7 @@ module RightAMQP
|
|
438
438
|
unless deleted
|
439
439
|
# Allowing declare to happen since queue may not exist and do not want NOT_FOUND
|
440
440
|
# failure to cause AMQP channel to close
|
441
|
-
@channel.queue(name, options).delete
|
441
|
+
@channel.queue(name, options.merge(:no_declare => true)).delete
|
442
442
|
deleted = true
|
443
443
|
end
|
444
444
|
rescue StandardError => e
|
data/right_amqp.gemspec
CHANGED
@@ -24,8 +24,8 @@ require 'rubygems'
|
|
24
24
|
|
25
25
|
Gem::Specification.new do |spec|
|
26
26
|
spec.name = 'right_amqp'
|
27
|
-
spec.version = '0.8.
|
28
|
-
spec.date = '2014-
|
27
|
+
spec.version = '0.8.6'
|
28
|
+
spec.date = '2014-11-12'
|
29
29
|
spec.authors = ['Lee Kirchhoff']
|
30
30
|
spec.email = 'lee@rightscale.com'
|
31
31
|
spec.homepage = 'https://github.com/rightscale/right_amqp'
|
@@ -898,11 +898,23 @@ describe RightAMQP::BrokerClient do
|
|
898
898
|
@queue.should_receive(:delete).once
|
899
899
|
broker = RightAMQP::BrokerClient.new(@identity, @address, @serializer, @exceptions, @non_deliveries, @options)
|
900
900
|
broker.subscribe({:name => "queue1"}, {:type => :direct, :name => "exchange"}) {|_, _|}
|
901
|
+
@channel.should_receive(:queue).with("queue1", on { |arg| arg[:no_declare] }).and_return(@queue).once
|
901
902
|
broker.queues.should == [@queue]
|
902
903
|
broker.delete("queue1").should be_true
|
903
904
|
broker.queues.should == []
|
904
905
|
end
|
905
906
|
|
907
|
+
it "should delete the named queue even if not it is not a currently open queue" do
|
908
|
+
queue2 = flexmock("queue2", :bind => @bind, :name => "queue2")
|
909
|
+
queue2.should_receive(:delete).once
|
910
|
+
broker = RightAMQP::BrokerClient.new(@identity, @address, @serializer, @exceptions, @non_deliveries, @options)
|
911
|
+
broker.subscribe({:name => "queue1"}, {:type => :direct, :name => "exchange"}) {|_, _|}
|
912
|
+
@channel.should_receive(:queue).with("queue2", on { |arg| arg[:no_declare] }).and_return(queue2).once
|
913
|
+
broker.queues.should == [@queue]
|
914
|
+
broker.delete("queue2").should be_true
|
915
|
+
broker.queues.should == [@queue]
|
916
|
+
end
|
917
|
+
|
906
918
|
it "should return false if the client is not usable" do
|
907
919
|
@queue.should_receive(:delete).never
|
908
920
|
broker = RightAMQP::BrokerClient.new(@identity, @address, @serializer, @exceptions, @non_deliveries, @options)
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: right_amqp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
12
|
+
date: 2014-11-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: right_support
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -24,10 +24,18 @@ dependencies:
|
|
24
24
|
version: '3.0'
|
25
25
|
type: :runtime
|
26
26
|
prerelease: false
|
27
|
-
version_requirements:
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.2'
|
33
|
+
- - <
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '3.0'
|
28
36
|
- !ruby/object:Gem::Dependency
|
29
37
|
name: eventmachine
|
30
|
-
requirement:
|
38
|
+
requirement: !ruby/object:Gem::Requirement
|
31
39
|
none: false
|
32
40
|
requirements:
|
33
41
|
- - ! '>='
|
@@ -38,7 +46,15 @@ dependencies:
|
|
38
46
|
version: '2.0'
|
39
47
|
type: :runtime
|
40
48
|
prerelease: false
|
41
|
-
version_requirements:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - ! '>='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.12.10
|
55
|
+
- - <
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '2.0'
|
42
58
|
description: ! 'RightAMQP provides a high availability client for interfacing with
|
43
59
|
the
|
44
60
|
|
@@ -120,10 +136,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
136
|
version: '0'
|
121
137
|
segments:
|
122
138
|
- 0
|
123
|
-
hash:
|
139
|
+
hash: -4034513993207482869
|
124
140
|
requirements: []
|
125
141
|
rubyforge_project:
|
126
|
-
rubygems_version: 1.8.
|
142
|
+
rubygems_version: 1.8.26
|
127
143
|
signing_key:
|
128
144
|
specification_version: 3
|
129
145
|
summary: Client for interfacing to RightScale RabbitMQ broker using AMQP
|