amqp 0.9.8 → 0.9.9
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.
- data/README.md +81 -72
- data/amqp.gemspec +5 -13
- data/docs/08Migration.textile +4 -0
- data/docs/AMQP091ModelExplained.textile +5 -0
- data/docs/Bindings.textile +4 -0
- data/docs/Clustering.textile +4 -0
- data/docs/ConnectingToTheBroker.textile +4 -0
- data/docs/ConnectionEncryptionWithTLS.textile +4 -0
- data/docs/DocumentationGuidesIndex.textile +4 -0
- data/docs/Durability.textile +4 -0
- data/docs/ErrorHandling.textile +4 -0
- data/docs/Exchanges.textile +4 -0
- data/docs/GettingStarted.textile +4 -0
- data/docs/PatternsAndUseCases.textile +4 -1
- data/docs/Queues.textile +4 -0
- data/docs/RabbitMQVersions.textile +4 -0
- data/docs/RunningTests.textile +4 -0
- data/docs/TestingWithEventedSpec.textile +4 -0
- data/docs/Troubleshooting.textile +4 -0
- data/docs/VendorSpecificExtensions.textile +4 -0
- data/lib/amqp/channel.rb +13 -12
- data/lib/amqp/client.rb +2 -2
- data/lib/amqp/connection.rb +1 -0
- data/lib/amqp/consumer.rb +2 -2
- data/lib/amqp/exchange.rb +5 -5
- data/lib/amqp/queue.rb +1 -1
- data/lib/amqp/session.rb +4 -4
- data/lib/amqp/version.rb +1 -1
- data/spec/integration/exchange_declaration_spec.rb +71 -102
- data/spec/integration/queue_redeclaration_with_incompatible_attributes_spec.rb +25 -12
- data/spec/integration/remove_individual_binding_spec.rb +51 -0
- metadata +92 -102
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe AMQP do
|
5
|
+
describe "AMQP queue redeclaration with different attributes" do
|
6
6
|
|
7
7
|
#
|
8
8
|
# Environment
|
@@ -17,7 +17,7 @@ describe AMQP do
|
|
17
17
|
# Examples
|
18
18
|
#
|
19
19
|
|
20
|
-
context "when
|
20
|
+
context "when :durable value is different" do
|
21
21
|
let(:name) { "amqp-gem.nondurable.queue" }
|
22
22
|
let(:options) {
|
23
23
|
{ :durable => false, :exclusive => true, :auto_delete => true, :arguments => {}, :passive => false }
|
@@ -25,35 +25,48 @@ describe AMQP do
|
|
25
25
|
let(:different_options) {
|
26
26
|
{ :durable => true, :exclusive => true, :auto_delete => true, :arguments => {}, :passive => false}
|
27
27
|
}
|
28
|
-
let(:irrelevant_different_options) {
|
29
|
-
{ :durable => false, :exclusive => true, :auto_delete => true, :arguments => {}, :passive => false, :header => {:random => 'stuff' } }
|
30
|
-
}
|
31
28
|
|
32
29
|
|
33
30
|
it "should raise AMQP::IncompatibleOptionsError for incompatable options" do
|
34
31
|
channel = AMQP::Channel.new
|
35
|
-
channel.on_error do |ch,
|
36
|
-
@
|
32
|
+
channel.on_error do |ch, channel_close|
|
33
|
+
@error_code = channel_close.reply_code
|
37
34
|
end
|
38
35
|
|
39
36
|
channel.queue(name, options)
|
40
37
|
expect {
|
41
38
|
channel.queue(name, different_options)
|
42
39
|
}.to raise_error(AMQP::IncompatibleOptionsError)
|
43
|
-
|
40
|
+
|
41
|
+
done(0.5) {
|
42
|
+
@error_code.should == 406
|
43
|
+
}
|
44
44
|
end
|
45
|
+
end
|
46
|
+
|
47
|
+
context "when :headers are different" do
|
48
|
+
let(:name) { "amqp-gem.nondurable.queue" }
|
49
|
+
let(:options) {
|
50
|
+
{ :durable => false, :exclusive => true, :auto_delete => true, :arguments => {}, :passive => false }
|
51
|
+
}
|
52
|
+
let(:different_options) {
|
53
|
+
{ :durable => false, :exclusive => true, :auto_delete => true, :arguments => {}, :passive => false, :header => {:random => 'stuff' } }
|
54
|
+
}
|
45
55
|
|
46
56
|
it "should not raise AMQP::IncompatibleOptionsError for irrelevant options" do
|
47
57
|
channel = AMQP::Channel.new
|
48
|
-
channel.on_error do |ch,
|
49
|
-
@
|
58
|
+
channel.on_error do |ch, channel_close|
|
59
|
+
@error_code = channel_close.reply_code
|
50
60
|
end
|
51
61
|
|
52
62
|
channel.queue(name, options)
|
53
63
|
expect {
|
54
|
-
channel.queue(name,
|
64
|
+
channel.queue(name, different_options)
|
55
65
|
}.to_not raise_error(AMQP::IncompatibleOptionsError)
|
56
|
-
|
66
|
+
|
67
|
+
done(0.5) {
|
68
|
+
@error_code.should == 406
|
69
|
+
}
|
57
70
|
end
|
58
71
|
end
|
59
72
|
end # describe AMQP
|
@@ -0,0 +1,51 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
|
5
|
+
describe "An individual binding" do
|
6
|
+
|
7
|
+
#
|
8
|
+
# Environment
|
9
|
+
#
|
10
|
+
|
11
|
+
include EventedSpec::AMQPSpec
|
12
|
+
|
13
|
+
default_timeout 3
|
14
|
+
|
15
|
+
amqp_before do
|
16
|
+
@channel = AMQP::Channel.new
|
17
|
+
@channel.should be_open
|
18
|
+
@channel.on_error do |ch, close|
|
19
|
+
raise "Channel-level error!: #{close.inspect}"
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
|
24
|
+
default_options AMQP_OPTS
|
25
|
+
|
26
|
+
|
27
|
+
it "can be deleted by specifying routing key" do
|
28
|
+
flag1 = false
|
29
|
+
flag2 = false
|
30
|
+
|
31
|
+
x = @channel.direct("amqpgem.examples.imaging")
|
32
|
+
|
33
|
+
q = @channel.queue("", :exclusive => true)
|
34
|
+
q.bind(x, :routing_key => "resize").bind(x, :routing_key => "watermark").subscribe do |meta, payload|
|
35
|
+
flag1 = (meta.routing_key == "watermark")
|
36
|
+
flag2 = (meta.routing_key == "resize")
|
37
|
+
end
|
38
|
+
|
39
|
+
EventMachine.add_timer(0.5) do
|
40
|
+
q.unbind(x, :routing_key => "resize") do
|
41
|
+
x.publish("some data", :routing_key => "resize")
|
42
|
+
x.publish("some data", :routing_key => "watermark")
|
43
|
+
end
|
44
|
+
|
45
|
+
done(1.0) {
|
46
|
+
flag1.should be_true
|
47
|
+
flag2.should be_false
|
48
|
+
}
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
metadata
CHANGED
@@ -1,103 +1,101 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: amqp
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 9
|
9
|
-
- 8
|
10
|
-
version: 0.9.8
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.9.9
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Aman Gupta
|
14
9
|
- Jakub Stastny aka botanicus
|
15
10
|
- Michael S. Klishin
|
16
|
-
autorequire:
|
11
|
+
autorequire:
|
17
12
|
bindir: bin
|
18
13
|
cert_chain: []
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Dependency
|
14
|
+
date: 2013-02-21 00:00:00.000000000 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
23
17
|
name: eventmachine
|
24
|
-
|
25
|
-
|
18
|
+
version_requirements: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - ">="
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: !binary |-
|
23
|
+
MA==
|
26
24
|
none: false
|
27
|
-
|
25
|
+
requirement: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
28
27
|
- - ">="
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: !binary |-
|
30
|
+
MA==
|
31
|
+
none: false
|
32
|
+
prerelease: false
|
34
33
|
type: :runtime
|
35
|
-
|
36
|
-
- !ruby/object:Gem::Dependency
|
34
|
+
- !ruby/object:Gem::Dependency
|
37
35
|
name: amq-client
|
38
|
-
|
39
|
-
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.9.12
|
40
41
|
none: false
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
- 5
|
49
|
-
version: 0.9.5
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 0.9.12
|
47
|
+
none: false
|
48
|
+
prerelease: false
|
50
49
|
type: :runtime
|
51
|
-
|
52
|
-
- !ruby/object:Gem::Dependency
|
50
|
+
- !ruby/object:Gem::Dependency
|
53
51
|
name: amq-protocol
|
54
|
-
|
55
|
-
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: 1.2.0
|
56
57
|
none: false
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
- 4
|
65
|
-
version: 0.9.4
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 1.2.0
|
63
|
+
none: false
|
64
|
+
prerelease: false
|
66
65
|
type: :runtime
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
-
|
66
|
+
description: Widely used, feature-rich asynchronous AMQP RabbitMQ client with batteries included.
|
67
|
+
email:
|
68
|
+
- !binary |-
|
69
|
+
bWljaGFlbEBub3ZlbWJlcmFpbi5jb20=
|
70
|
+
- !binary |-
|
71
|
+
c3Rhc3RueUAxMDFpZGVhcy5jeg==
|
72
72
|
executables: []
|
73
|
-
|
74
73
|
extensions: []
|
75
|
-
|
76
|
-
extra_rdoc_files:
|
74
|
+
extra_rdoc_files:
|
77
75
|
- README.md
|
76
|
+
- docs/08Migration.textile
|
77
|
+
- docs/AMQP091ModelExplained.textile
|
78
|
+
- docs/Bindings.textile
|
79
|
+
- docs/Clustering.textile
|
80
|
+
- docs/ConnectingToTheBroker.textile
|
81
|
+
- docs/ConnectionEncryptionWithTLS.textile
|
82
|
+
- docs/DocumentationGuidesIndex.textile
|
78
83
|
- docs/Durability.textile
|
84
|
+
- docs/ErrorHandling.textile
|
79
85
|
- docs/Exchanges.textile
|
86
|
+
- docs/GettingStarted.textile
|
80
87
|
- docs/PatternsAndUseCases.textile
|
81
|
-
- docs/
|
82
|
-
- docs/
|
88
|
+
- docs/Queues.textile
|
89
|
+
- docs/RabbitMQVersions.textile
|
83
90
|
- docs/RunningTests.textile
|
84
|
-
- docs/
|
91
|
+
- docs/TestingWithEventedSpec.textile
|
85
92
|
- docs/Troubleshooting.textile
|
86
|
-
- docs/RabbitMQVersions.textile
|
87
|
-
- docs/Queues.textile
|
88
|
-
- docs/08Migration.textile
|
89
93
|
- docs/VendorSpecificExtensions.textile
|
90
|
-
|
91
|
-
-
|
92
|
-
-
|
93
|
-
-
|
94
|
-
-
|
95
|
-
- docs/TestingWithEventedSpec.textile
|
96
|
-
files:
|
97
|
-
- .gitignore
|
98
|
-
- .rspec
|
99
|
-
- .travis.yml
|
100
|
-
- .yardopts
|
94
|
+
files:
|
95
|
+
- ".gitignore"
|
96
|
+
- ".rspec"
|
97
|
+
- ".travis.yml"
|
98
|
+
- ".yardopts"
|
101
99
|
- CHANGELOG
|
102
100
|
- Gemfile
|
103
101
|
- README.md
|
@@ -321,6 +319,7 @@ files:
|
|
321
319
|
- spec/integration/regressions/concurrent_publishing_on_the_same_channel_spec.rb
|
322
320
|
- spec/integration/regressions/empty_message_body_spec.rb
|
323
321
|
- spec/integration/regressions/issue66_spec.rb
|
322
|
+
- spec/integration/remove_individual_binding_spec.rb
|
324
323
|
- spec/integration/reply_queue_communication_spec.rb
|
325
324
|
- spec/integration/store_and_forward_spec.rb
|
326
325
|
- spec/integration/stress/publishing_of_messages_with_incrementing_sizes_spec.rb
|
@@ -333,41 +332,32 @@ files:
|
|
333
332
|
- spec/unit/amqp/client_spec.rb
|
334
333
|
- spec/unit/amqp/connection_spec.rb
|
335
334
|
- spec/unit/amqp/int_allocator_spec.rb
|
336
|
-
homepage: http://
|
335
|
+
homepage: http://rubyamqp.info
|
337
336
|
licenses: []
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
rdoc_options:
|
343
|
-
- --include=examples --main README.md
|
344
|
-
require_paths:
|
337
|
+
post_install_message:
|
338
|
+
rdoc_options:
|
339
|
+
- "--include=examples --main README.md"
|
340
|
+
require_paths:
|
345
341
|
- lib
|
346
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
347
|
-
|
348
|
-
requirements:
|
342
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
343
|
+
requirements:
|
349
344
|
- - ">="
|
350
|
-
- !ruby/object:Gem::Version
|
351
|
-
|
352
|
-
|
353
|
-
- 0
|
354
|
-
version: "0"
|
355
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
345
|
+
- !ruby/object:Gem::Version
|
346
|
+
version: !binary |-
|
347
|
+
MA==
|
356
348
|
none: false
|
357
|
-
|
349
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
350
|
+
requirements:
|
358
351
|
- - ">="
|
359
|
-
- !ruby/object:Gem::Version
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
version: "0"
|
352
|
+
- !ruby/object:Gem::Version
|
353
|
+
version: !binary |-
|
354
|
+
MA==
|
355
|
+
none: false
|
364
356
|
requirements: []
|
365
|
-
|
366
357
|
rubyforge_project: amqp
|
367
358
|
rubygems_version: 1.8.24
|
368
|
-
signing_key:
|
359
|
+
signing_key:
|
369
360
|
specification_version: 3
|
370
|
-
summary: Widely used, feature-rich asynchronous
|
361
|
+
summary: Widely used, feature-rich asynchronous RabbitMQ client with batteries included
|
371
362
|
test_files: []
|
372
|
-
|
373
|
-
has_rdoc:
|
363
|
+
has_rdoc:
|