amq-client 0.7.0.alpha32 → 0.7.0.alpha33
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/lib/amq/client/adapter.rb +24 -5
- data/lib/amq/client/entity.rb +4 -11
- data/lib/amq/client/exchange.rb +1 -3
- data/lib/amq/client/version.rb +1 -1
- metadata +5 -5
data/lib/amq/client/adapter.rb
CHANGED
@@ -47,16 +47,31 @@ module AMQ
|
|
47
47
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.2.1)
|
48
48
|
attr_accessor :client_properties
|
49
49
|
|
50
|
-
# Server
|
50
|
+
# Server properties
|
51
51
|
#
|
52
52
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.1.3)
|
53
53
|
attr_reader :server_properties
|
54
54
|
|
55
|
+
# Server capabilities
|
56
|
+
#
|
57
|
+
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.1.3)
|
58
|
+
attr_reader :server_capabilities
|
59
|
+
|
60
|
+
# Locales server supports
|
61
|
+
#
|
62
|
+
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.1.3)
|
63
|
+
attr_reader :server_locales
|
64
|
+
|
55
65
|
# Authentication mechanism used.
|
56
66
|
#
|
57
67
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.2)
|
58
68
|
attr_reader :mechanism
|
59
69
|
|
70
|
+
# Authentication mechanisms broker supports.
|
71
|
+
#
|
72
|
+
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.2)
|
73
|
+
attr_reader :server_authentication_mechanisms
|
74
|
+
|
60
75
|
# Channels within this connection.
|
61
76
|
#
|
62
77
|
# @see http://bit.ly/hw2ELX AMQP 0.9.1 specification (Section 2.2.5)
|
@@ -386,7 +401,11 @@ module AMQ
|
|
386
401
|
# @api plugin
|
387
402
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.1.)
|
388
403
|
def handle_start(connection_start)
|
389
|
-
@server_properties
|
404
|
+
@server_properties = connection_start.server_properties.dup.freeze
|
405
|
+
@server_capabilities = @server_properties["capabilities"].dup.freeze
|
406
|
+
|
407
|
+
@server_authentication_mechanisms = connection_start.mechanisms.split(" ").freeze
|
408
|
+
@server_locales = Array(connection_start.locales).freeze
|
390
409
|
|
391
410
|
username = @settings[:user] || @settings[:username]
|
392
411
|
password = @settings[:pass] || @settings[:password]
|
@@ -405,8 +424,8 @@ module AMQ
|
|
405
424
|
# @api plugin
|
406
425
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.6)
|
407
426
|
def handle_tune(tune_ok)
|
408
|
-
@channel_max = tune_ok.channel_max
|
409
|
-
@frame_max = tune_ok.frame_max
|
427
|
+
@channel_max = tune_ok.channel_max.freeze
|
428
|
+
@frame_max = tune_ok.frame_max.freeze
|
410
429
|
@heartbeat_interval = self.heartbeat_interval || tune_ok.heartbeat
|
411
430
|
|
412
431
|
self.send_frame(Protocol::Connection::TuneOk.encode(@channel_max, [settings[:frame_max], @frame_max].min, @heartbeat_interval))
|
@@ -418,7 +437,7 @@ module AMQ
|
|
418
437
|
# @api plugin
|
419
438
|
# @see http://bit.ly/htCzCX AMQP 0.9.1 protocol documentation (Section 1.4.2.8.)
|
420
439
|
def handle_open_ok(open_ok)
|
421
|
-
@known_hosts = open_ok.known_hosts
|
440
|
+
@known_hosts = open_ok.known_hosts.dup.freeze
|
422
441
|
|
423
442
|
opened!
|
424
443
|
self.connection_successful if self.respond_to?(:connection_successful)
|
data/lib/amq/client/entity.rb
CHANGED
@@ -58,14 +58,7 @@ module AMQ
|
|
58
58
|
# Be careful with default values for #ruby hashes: h = Hash.new(Array.new); h[:key] ||= 1
|
59
59
|
# won't assign anything to :key. MK.
|
60
60
|
@callbacks = Hash.new
|
61
|
-
end
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
callbacks = [@callbacks[:close]].flatten.compact
|
66
|
-
|
67
|
-
callbacks.map { |c| c.call(exception) } if callbacks.any?
|
68
|
-
end
|
69
|
-
end
|
70
|
-
end
|
71
|
-
end
|
61
|
+
end # initialize
|
62
|
+
end # Entity
|
63
|
+
end # Client
|
64
|
+
end # AMQ
|
data/lib/amq/client/exchange.rb
CHANGED
@@ -93,12 +93,10 @@ module AMQ
|
|
93
93
|
end # delete(if_unused = false, nowait = false)
|
94
94
|
|
95
95
|
|
96
|
-
def publish(payload, routing_key = AMQ::Protocol::EMPTY_STRING, user_headers = {}, mandatory = false, immediate = false, frame_size = nil
|
96
|
+
def publish(payload, routing_key = AMQ::Protocol::EMPTY_STRING, user_headers = {}, mandatory = false, immediate = false, frame_size = nil)
|
97
97
|
headers = { :priority => 0, :delivery_mode => 2, :content_type => "application/octet-stream" }.merge(user_headers)
|
98
98
|
@connection.send_frameset(Protocol::Basic::Publish.encode(@channel.id, payload, headers, @name, routing_key, mandatory, immediate, (frame_size || @connection.frame_max)))
|
99
99
|
|
100
|
-
block.call if block
|
101
|
-
|
102
100
|
self
|
103
101
|
end
|
104
102
|
|
data/lib/amq/client/version.rb
CHANGED
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: -
|
4
|
+
hash: -3702664338
|
5
5
|
prerelease: 6
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
9
|
- 0
|
10
10
|
- alpha
|
11
|
-
-
|
12
|
-
version: 0.7.0.
|
11
|
+
- 33
|
12
|
+
version: 0.7.0.alpha33
|
13
13
|
platform: ruby
|
14
14
|
authors:
|
15
15
|
- Jakub Stastny
|
@@ -20,7 +20,7 @@ autorequire:
|
|
20
20
|
bindir: bin
|
21
21
|
cert_chain: []
|
22
22
|
|
23
|
-
date: 2011-
|
23
|
+
date: 2011-06-04 00:00:00 Z
|
24
24
|
dependencies:
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: eventmachine
|
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
256
|
requirements: []
|
257
257
|
|
258
258
|
rubyforge_project: amq-client
|
259
|
-
rubygems_version: 1.8.
|
259
|
+
rubygems_version: 1.8.5
|
260
260
|
signing_key:
|
261
261
|
specification_version: 3
|
262
262
|
summary: amq-client is a fully-featured, low-level AMQP 0.9.1 client
|