amq-client 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
data/lib/amq/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,54 +1,56 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.1
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jakub Stastny
|
9
9
|
- Michael S. Klishin
|
10
10
|
- Theo Hultberg
|
11
11
|
- Mark Abramov
|
12
|
-
autorequire:
|
12
|
+
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2013-
|
15
|
+
date: 2013-04-25 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: eventmachine
|
19
|
-
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
none: false
|
20
21
|
requirements:
|
21
|
-
- -
|
22
|
+
- - ! '>='
|
22
23
|
- !ruby/object:Gem::Version
|
23
|
-
version:
|
24
|
-
|
24
|
+
version: '0'
|
25
|
+
type: :runtime
|
26
|
+
prerelease: false
|
27
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
28
|
none: false
|
26
|
-
requirement: !ruby/object:Gem::Requirement
|
27
29
|
requirements:
|
28
|
-
- -
|
30
|
+
- - ! '>='
|
29
31
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
31
|
-
MA==
|
32
|
-
none: false
|
33
|
-
prerelease: false
|
34
|
-
type: :runtime
|
32
|
+
version: '0'
|
35
33
|
- !ruby/object:Gem::Dependency
|
36
34
|
name: amq-protocol
|
37
|
-
|
35
|
+
requirement: !ruby/object:Gem::Requirement
|
36
|
+
none: false
|
38
37
|
requirements:
|
39
|
-
- -
|
38
|
+
- - ! '>='
|
40
39
|
- !ruby/object:Gem::Version
|
41
40
|
version: 1.2.0
|
41
|
+
type: :runtime
|
42
|
+
prerelease: false
|
43
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
44
|
none: false
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
45
|
requirements:
|
45
|
-
- -
|
46
|
+
- - ! '>='
|
46
47
|
- !ruby/object:Gem::Version
|
47
48
|
version: 1.2.0
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
description: amq-client is a fully-featured, low-level AMQP 0.9.1 client with pluggable
|
50
|
+
networking I/O adapters (EventMachine, cool.io, Eventpanda and so on) and supposed
|
51
|
+
to back more opinionated AMQP clients (such as amqp gem) or be used directly in
|
52
|
+
cases when access to more advanced AMQP 0.9.1 features is more important that convenient
|
53
|
+
APIs
|
52
54
|
email:
|
53
55
|
- !binary |-
|
54
56
|
c3Rhc3RueUAxMDFpZGVhcy5jeg==
|
@@ -58,11 +60,11 @@ extensions: []
|
|
58
60
|
extra_rdoc_files:
|
59
61
|
- README.textile
|
60
62
|
files:
|
61
|
-
-
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
65
|
-
-
|
63
|
+
- .gitignore
|
64
|
+
- .gitmodules
|
65
|
+
- .rspec
|
66
|
+
- .travis.yml
|
67
|
+
- .yardopts
|
66
68
|
- Gemfile
|
67
69
|
- LICENSE
|
68
70
|
- README.textile
|
@@ -201,11 +203,9 @@ files:
|
|
201
203
|
- spec/integration/eventmachine/basic_cancel_spec.rb
|
202
204
|
- spec/integration/eventmachine/basic_consume_spec.rb
|
203
205
|
- spec/integration/eventmachine/basic_get_spec.rb
|
204
|
-
- spec/integration/eventmachine/basic_publish_with_framing_spec.rb
|
205
206
|
- spec/integration/eventmachine/basic_return_spec.rb
|
206
207
|
- spec/integration/eventmachine/channel_close_spec.rb
|
207
208
|
- spec/integration/eventmachine/channel_flow_spec.rb
|
208
|
-
- spec/integration/eventmachine/concurrent_basic_publish_spec.rb
|
209
209
|
- spec/integration/eventmachine/connection_close_spec.rb
|
210
210
|
- spec/integration/eventmachine/connection_start_spec.rb
|
211
211
|
- spec/integration/eventmachine/consumer_cancellation_notification_spec.rb
|
@@ -226,29 +226,27 @@ files:
|
|
226
226
|
- tasks.rb
|
227
227
|
homepage: http://github.com/ruby-amqp/amq-client
|
228
228
|
licenses: []
|
229
|
-
post_install_message:
|
229
|
+
post_install_message:
|
230
230
|
rdoc_options: []
|
231
231
|
require_paths:
|
232
232
|
- lib
|
233
233
|
required_ruby_version: !ruby/object:Gem::Requirement
|
234
|
+
none: false
|
234
235
|
requirements:
|
235
|
-
- -
|
236
|
+
- - ! '>='
|
236
237
|
- !ruby/object:Gem::Version
|
237
|
-
version:
|
238
|
-
MA==
|
239
|
-
none: false
|
238
|
+
version: '0'
|
240
239
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
|
+
none: false
|
241
241
|
requirements:
|
242
|
-
- -
|
242
|
+
- - ! '>='
|
243
243
|
- !ruby/object:Gem::Version
|
244
|
-
version:
|
245
|
-
MA==
|
246
|
-
none: false
|
244
|
+
version: '0'
|
247
245
|
requirements: []
|
248
246
|
rubyforge_project: amq-client
|
249
|
-
rubygems_version: 1.8.
|
250
|
-
signing_key:
|
247
|
+
rubygems_version: 1.8.25
|
248
|
+
signing_key:
|
251
249
|
specification_version: 3
|
252
250
|
summary: amq-client is a fully-featured, low-level AMQP 0.9.1 client
|
253
251
|
test_files: []
|
254
|
-
has_rdoc:
|
252
|
+
has_rdoc:
|
@@ -1,56 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'integration/eventmachine/spec_helper'
|
5
|
-
|
6
|
-
require "multi_json"
|
7
|
-
|
8
|
-
describe AMQ::Client::EventMachineClient, "Basic.Publish" do
|
9
|
-
include EventedSpec::SpecHelper
|
10
|
-
default_timeout 21.0
|
11
|
-
|
12
|
-
context "when message size exceeds negotiated frame size" do
|
13
|
-
let(:message) { "z" * 1024 * 1024 * 2 }
|
14
|
-
|
15
|
-
it "correctly frames things" do
|
16
|
-
@received_messages = []
|
17
|
-
|
18
|
-
@received_messages = []
|
19
|
-
em_amqp_connect do |client|
|
20
|
-
client.on_error do |conn, connection_close|
|
21
|
-
fail "Handling a connection-level exception: #{connection_close.reply_text}"
|
22
|
-
end
|
23
|
-
|
24
|
-
channel = AMQ::Client::Channel.new(client, 1)
|
25
|
-
channel.open do
|
26
|
-
queue = AMQ::Client::Queue.new(client, channel).declare(false, false, false, true)
|
27
|
-
queue.bind("amq.fanout")
|
28
|
-
|
29
|
-
queue.consume(true) do |amq_method|
|
30
|
-
queue.on_delivery do |method, header, payload|
|
31
|
-
@received_messages << payload
|
32
|
-
end
|
33
|
-
|
34
|
-
exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
|
35
|
-
EventMachine.add_timer(2.0) do
|
36
|
-
30.times do
|
37
|
-
Thread.new do
|
38
|
-
exchange.publish(message, queue.name, {}, false, true)
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
delayed(15.0) {
|
45
|
-
# we don't care about the exact number, just the fact that there are
|
46
|
-
# no UNEXPECTED_FRAME connection-level exceptions. MK.
|
47
|
-
@received_messages.size.should > 10
|
48
|
-
@received_messages.all? {|m| m == message}.should be_true
|
49
|
-
|
50
|
-
done
|
51
|
-
}
|
52
|
-
end
|
53
|
-
end # em_amqp_connect
|
54
|
-
end # it
|
55
|
-
end # context
|
56
|
-
end # describe
|
@@ -1,79 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
require 'spec_helper'
|
4
|
-
require 'integration/eventmachine/spec_helper'
|
5
|
-
|
6
|
-
|
7
|
-
include PlatformDetection
|
8
|
-
|
9
|
-
if mri?
|
10
|
-
require "multi_json"
|
11
|
-
|
12
|
-
describe AMQ::Client::EventMachineClient, "Basic.Publish" do
|
13
|
-
include EventedSpec::SpecHelper
|
14
|
-
default_timeout 21.0
|
15
|
-
|
16
|
-
context "when messages are published across threads" do
|
17
|
-
let(:inputs) do
|
18
|
-
[
|
19
|
-
{ :index=>{:_routing=>530,:_index=>"optimizer",:_type=>"earnings",:_id=>530}},
|
20
|
-
{ :total_conversions=>0,:banked_clicks=>0,:total_earnings=>0,:pending_conversions=>0,:paid_net_earnings=>0,:banked_conversions=>0,:pending_earnings=>0,:optimizer_id=>530,:total_impressions=>0,:banked_earnings=>0,:bounce_count=>0,:time_on_page=>0,:total_clicks=>0,:entrances=>0,:pending_clicks=>0,:paid_earnings=>0},
|
21
|
-
|
22
|
-
{ :index=>{:_routing=>430,:_index=>"optimizer",:_type=>"earnings",:_id=>430}},
|
23
|
-
{ :total_conversions=>1443,:banked_clicks=>882,:total_earnings=>5796.3315841537,:pending_conversions=>22,:paid_net_earnings=>4116.90224486802,:banked_conversions=>1086,:pending_earnings=>257.502767857143,:optimizer_id=>430,:total_impressions=>6370497,:banked_earnings=>122.139339285714,:bounce_count=>6825,:time_on_page=>0,:total_clicks=>38143,:entrances=>12336,:pending_clicks=>1528,:paid_earnings=>5670.78224486798},
|
24
|
-
|
25
|
-
{ :index=>{:_routing=>506,:_index=>"optimizer",:_type=>"earnings",:_id=>506}},
|
26
|
-
{ :total_conversions=>237,:banked_clicks=>232,:total_earnings=>550.6212071428588277,:pending_conversions=>9,:paid_net_earnings=>388.021207142857,:banked_conversions=>225,:pending_earnings=>150.91,:optimizer_id=>506,:total_impressions=>348319,:banked_earnings=>12.92,:bounce_count=>905,:time_on_page=>0,:total_clicks=>4854,:entrances=>1614,:pending_clicks=>1034,:paid_earnings=>537.501207142858},
|
27
|
-
|
28
|
-
{:index=>{:_routing=>345,:_index=>"optimizer",:_type=>"earnings",:_id=>345}},
|
29
|
-
{:total_conversions=>0,:banked_clicks=>0,:total_earnings=>0,:pending_conversions=>0,:paid_net_earnings=>0,:banked_conversions=>0,:pending_earnings=>0,:optimizer_id=>345,:total_impressions=>0,:banked_earnings=>0,:bounce_count=>0,:time_on_page=>0,:total_clicks=>0,:entrances=>0,:pending_clicks=>0,:paid_earnings=>0}
|
30
|
-
]
|
31
|
-
end
|
32
|
-
let(:messages) { inputs.map {|i| MultiJson.encode(i) } * 3 }
|
33
|
-
|
34
|
-
# the purpose of this is to make sure UNEXPECTED_FRAME issues are gone
|
35
|
-
it "synchronizes on channel" do
|
36
|
-
@received_messages = []
|
37
|
-
|
38
|
-
@received_messages = []
|
39
|
-
em_amqp_connect do |client|
|
40
|
-
client.on_error do |conn, connection_close|
|
41
|
-
fail "Handling a connection-level exception: #{connection_close.reply_text}"
|
42
|
-
end
|
43
|
-
|
44
|
-
channel = AMQ::Client::Channel.new(client, 1)
|
45
|
-
channel.open do
|
46
|
-
queue = AMQ::Client::Queue.new(client, channel).declare(false, false, false, true)
|
47
|
-
queue.bind("amq.fanout")
|
48
|
-
|
49
|
-
queue.consume(true) do |amq_method|
|
50
|
-
queue.on_delivery do |method, header, payload|
|
51
|
-
@received_messages << payload
|
52
|
-
end
|
53
|
-
|
54
|
-
exchange = AMQ::Client::Exchange.new(client, channel, "amq.fanout", :fanout)
|
55
|
-
EventMachine.add_timer(2.0) do
|
56
|
-
# ZOMG THREADS!
|
57
|
-
30.times do
|
58
|
-
Thread.new do
|
59
|
-
messages.each do |message|
|
60
|
-
exchange.publish(message, queue.name, {}, false, false)
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
64
|
-
end
|
65
|
-
end
|
66
|
-
|
67
|
-
# let it run for several seconds because you know, concurrency issues do not always manifest themselves
|
68
|
-
# immediately. MK.
|
69
|
-
done(14.0) {
|
70
|
-
# we don't care about the exact number, just the fact that there are
|
71
|
-
# no UNEXPECTED_FRAME connection-level exceptions. MK.
|
72
|
-
@received_messages.size.should > 120
|
73
|
-
}
|
74
|
-
end
|
75
|
-
end # em_amqp_connect
|
76
|
-
end # it
|
77
|
-
end # context
|
78
|
-
end # describe
|
79
|
-
end
|