bunny 0.0.8

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.
@@ -0,0 +1,67 @@
1
+ $:.unshift File.expand_path(File.dirname(__FILE__))
2
+
3
+ %w[socket thread timeout amqp].each do |file|
4
+ require file
5
+ end
6
+
7
+ %w[ exchange queue header ].each do |file|
8
+ require "bunny/#{file}"
9
+ end
10
+
11
+ class Bunny
12
+
13
+ attr_reader :client
14
+
15
+ def initialize(opts = {})
16
+ @client = AMQP::Client.new(opts)
17
+ end
18
+
19
+ def logging=(bool)
20
+ client.logging = bool
21
+ end
22
+
23
+ def logging
24
+ client.logging
25
+ end
26
+
27
+ def start
28
+ client.start_session
29
+ end
30
+
31
+ def status
32
+ client.status
33
+ end
34
+
35
+ def exchange(name, opts = {})
36
+ client.exchanges[name] ||= Exchange.new(client, name, opts)
37
+ end
38
+
39
+ def queue(name, opts = {})
40
+ client.queues[name] ||= Queue.new(client, name, opts)
41
+ end
42
+
43
+ def stop
44
+ client.close
45
+ end
46
+
47
+ def queues
48
+ client.queues ||= {}
49
+ end
50
+
51
+ def exchanges
52
+ client.exchanges ||= {}
53
+ end
54
+
55
+ def host
56
+ client.host
57
+ end
58
+
59
+ def vhost
60
+ client.vhost
61
+ end
62
+
63
+ def port
64
+ client.port
65
+ end
66
+
67
+ end
@@ -0,0 +1,54 @@
1
+ class Exchange
2
+
3
+ include AMQP
4
+
5
+ attr_reader :client, :type, :name, :opts, :key
6
+
7
+ def initialize(client, name, opts = {})
8
+ # check connection to server
9
+ raise 'Not connected to server' if client.status == NOT_CONNECTED
10
+
11
+ @client, @name, @opts = client, name, opts
12
+ @type = opts[:type] || :direct
13
+ opts.delete(:type) unless opts[:type].nil?
14
+ @key = opts[:key]
15
+ @client.exchanges[@name] ||= self
16
+
17
+ unless name == "amq.#{type}" or name == ''
18
+ client.send_frame(
19
+ Protocol::Exchange::Declare.new(
20
+ { :exchange => name, :type => type, :nowait => true }.merge(opts)
21
+ )
22
+ )
23
+ end
24
+ end
25
+
26
+ def publish(data, opts = {})
27
+ out = []
28
+
29
+ out << Protocol::Basic::Publish.new(
30
+ { :exchange => name, :routing_key => opts.delete(:key) || key }.merge(opts)
31
+ )
32
+ data = data.to_s
33
+ out << Protocol::Header.new(
34
+ Protocol::Basic,
35
+ data.length, {
36
+ :content_type => 'application/octet-stream',
37
+ :delivery_mode => (opts.delete(:persistent) ? 2 : 1),
38
+ :priority => 0
39
+ }.merge(opts)
40
+ )
41
+ out << Frame::Body.new(data)
42
+
43
+ client.send_frame(*out)
44
+ end
45
+
46
+ def delete(opts = {})
47
+ client.send_frame(
48
+ Protocol::Exchange::Delete.new({ :exchange => name, :nowait => true }.merge(opts))
49
+ )
50
+
51
+ client.exchanges.delete(name)
52
+ end
53
+
54
+ end
@@ -0,0 +1,30 @@
1
+ class Header
2
+
3
+ include AMQP
4
+
5
+ attr_reader :client
6
+
7
+ def initialize(client, header_obj)
8
+ @client = client
9
+ @header = header_obj
10
+ end
11
+
12
+ # Acknowledges the receipt of this message with the server.
13
+ def ack
14
+ client.send(Protocol::Basic::Ack.new(:delivery_tag => properties[:delivery_tag]))
15
+ end
16
+
17
+ # Reject this message (XXX currently unimplemented in rabbitmq)
18
+ # * :requeue => true | false (default false)
19
+ def reject(opts = {})
20
+ client.send(Protocol::Basic::Reject.new(opts.merge(:delivery_tag => properties[:delivery_tag])))
21
+ end
22
+
23
+ def method_missing(meth, *args, &blk)
24
+ @header.send(meth, *args, &blk)
25
+ end
26
+
27
+ def inspect
28
+ @header.inspect
29
+ end
30
+ end
@@ -0,0 +1,111 @@
1
+ class Queue
2
+
3
+ include AMQP
4
+
5
+ attr_reader :name, :client
6
+ attr_accessor :delivery_tag
7
+
8
+ def initialize(client, name, opts = {})
9
+ # check connection to server
10
+ raise 'Not connected to server' if client.status == NOT_CONNECTED
11
+
12
+ @client = client
13
+ @opts = opts
14
+ @name = name
15
+ client.send_frame(
16
+ Protocol::Queue::Declare.new({ :queue => name, :nowait => true }.merge(opts))
17
+ )
18
+ end
19
+
20
+ def pop(opts = {})
21
+ self.delivery_tag = nil
22
+
23
+ # do we want the header?
24
+ hdr = opts.delete(:header)
25
+
26
+ client.send_frame(
27
+ Protocol::Basic::Get.new({ :queue => name,
28
+ :consumer_tag => name,
29
+ :no_ack => !opts.delete(:ack),
30
+ :nowait => true }.merge(opts))
31
+ )
32
+ method = client.next_method
33
+ return unless method.is_a?(Protocol::Basic::GetOk)
34
+
35
+ self.delivery_tag = method.delivery_tag
36
+
37
+ header = client.next_payload
38
+ msg = client.next_payload
39
+ raise 'unexpected length' if msg.length < header.size
40
+
41
+ hdr ? {:header => header, :payload => msg} : msg
42
+
43
+ end
44
+
45
+ def ack
46
+ client.send_frame(
47
+ Protocol::Basic::Ack.new(:delivery_tag => delivery_tag)
48
+ )
49
+ end
50
+
51
+ def publish(data, opts = {})
52
+ exchange.publish(data, opts)
53
+ end
54
+
55
+ def message_count
56
+ status.first
57
+ end
58
+
59
+ def consumer_count
60
+ status.last
61
+ end
62
+
63
+ def status(opts = {}, &blk)
64
+ client.send_frame(
65
+ Protocol::Queue::Declare.new({ :queue => name, :passive => true }.merge(opts))
66
+ )
67
+ method = client.next_method
68
+ [method.message_count, method.consumer_count]
69
+ end
70
+
71
+ def bind(exchange, opts = {})
72
+ exchange = exchange.respond_to?(:name) ? exchange.name : exchange
73
+ bindings[exchange] = opts
74
+ client.send_frame(
75
+ Protocol::Queue::Bind.new({ :queue => name,
76
+ :exchange => exchange,
77
+ :routing_key => opts.delete(:key),
78
+ :nowait => true }.merge(opts))
79
+ )
80
+ end
81
+
82
+ def unbind(exchange, opts = {})
83
+ exchange = exchange.respond_to?(:name) ? exchange.name : exchange
84
+ bindings.delete(exchange)
85
+
86
+ client.send_frame(
87
+ Protocol::Queue::Unbind.new({ :queue => name,
88
+ :exchange => exchange,
89
+ :routing_key => opts.delete(:key),
90
+ :nowait => true }.merge(opts)
91
+ )
92
+ )
93
+ end
94
+
95
+ def delete(opts = {})
96
+ client.send_frame(
97
+ Protocol::Queue::Delete.new({ :queue => name, :nowait => true }.merge(opts))
98
+ )
99
+
100
+ client.queues.delete(name)
101
+ end
102
+
103
+ private
104
+ def exchange
105
+ @exchange ||= Exchange.new(client, '', {:type => :direct, :key => name})
106
+ end
107
+
108
+ def bindings
109
+ @bindings ||= {}
110
+ end
111
+ end
@@ -0,0 +1,617 @@
1
+ /*
2
+ Copyright (c) 2008 John Leuner
3
+
4
+ Permission is hereby granted, free of charge, to any person
5
+ obtaining a copy of this file (the "Software"), to deal in the
6
+ Software without restriction, including without limitation the
7
+ rights to use, copy, modify, merge, publish, distribute,
8
+ sublicense, and/or sell copies of the Software, and to permit
9
+ persons to whom the Software is furnished to do so, subject to
10
+ the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.
23
+
24
+ Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf
25
+
26
+ b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf
27
+ http://www.twiststandards.org/index.php?option=com_docman&task=cat_view&gid=28&&Itemid=90
28
+ 8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf
29
+ https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1
30
+ */
31
+
32
+ {
33
+ "name": "AMQP",
34
+ "major-version": 8,
35
+ "minor-version": 0,
36
+ "port": 5672,
37
+
38
+ "domains": [
39
+ ["access-ticket", "short"],
40
+ ["bit", "bit"],
41
+ ["channel-id", "longstr"],
42
+ ["class-id", "short"],
43
+ ["consumer-tag", "shortstr"],
44
+ ["delivery-tag", "longlong"],
45
+ ["destination", "shortstr"],
46
+ ["duration", "longlong"],
47
+ ["exchange-name", "shortstr"],
48
+ ["known-hosts", "shortstr"],
49
+ ["long", "long"],
50
+ ["longlong", "longlong"],
51
+ ["longstr", "longstr"],
52
+ ["method-id", "short"],
53
+ ["no-ack", "bit"],
54
+ ["no-local", "bit"],
55
+ ["octet", "octet"],
56
+ ["offset", "longlong"],
57
+ ["path", "shortstr"],
58
+ ["peer-properties", "table"],
59
+ ["queue-name", "shortstr"],
60
+ ["redelivered", "bit"],
61
+ ["reference", "longstr"],
62
+ ["reject-code", "short"],
63
+ ["reject-text", "shortstr"],
64
+ ["reply-code", "short"],
65
+ ["reply-text", "shortstr"],
66
+ ["security-token", "longstr"],
67
+ ["short", "short"],
68
+ ["shortstr", "shortstr"],
69
+ ["table", "table"],
70
+ ["timestamp", "timestamp"]
71
+ ],
72
+
73
+ "constants": [
74
+ {"name": "FRAME-METHOD", "value": 1},
75
+ {"name": "FRAME-HEADER", "value": 2},
76
+ {"name": "FRAME-BODY", "value": 3},
77
+ {"name": "FRAME-OOB-METHOD", "value": 4},
78
+ {"name": "FRAME-OOB-HEADER", "value": 5},
79
+ {"name": "FRAME-OOB-BODY", "value": 6},
80
+ {"name": "FRAME-TRACE", "value": 7},
81
+ {"name": "FRAME-HEARTBEAT", "value": 8},
82
+ {"name": "FRAME-MIN-SIZE", "value": 4096},
83
+ {"name": "FRAME-END", "value": 206},
84
+ {"name": "REPLY-SUCCESS", "value": 200},
85
+ {"name": "NOT-DELIVERED", "value": 310, "class": "soft-error"},
86
+ {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"},
87
+ {"name": "NO-ROUTE", "value": 312, "class": "soft-error"},
88
+ {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"},
89
+ {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"},
90
+ {"name": "NOT-FOUND", "value": 404, "class": "soft-error"},
91
+ {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"},
92
+ {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"},
93
+ {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"},
94
+ {"name": "INVALID-PATH", "value": 402, "class": "hard-error"},
95
+ {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"},
96
+ {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"},
97
+ {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"},
98
+ {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"},
99
+ {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"},
100
+ {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"},
101
+ {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"},
102
+ {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"}
103
+ ],
104
+
105
+ "classes": [
106
+ {
107
+ "id": 10,
108
+ "methods": [{"id": 10,
109
+ "arguments": [{"type": "octet", "name": "version-major"},
110
+ {"type": "octet", "name": "version-minor"},
111
+ {"domain": "peer-properties", "name": "server properties"},
112
+ {"type": "longstr", "name": "mechanisms"},
113
+ {"type": "longstr", "name": "locales"}],
114
+ "name": "start"},
115
+ {"id": 11,
116
+ "arguments": [{"domain": "peer-properties", "name": "client-properties"},
117
+ {"type": "shortstr", "name": "mechanism"},
118
+ {"type": "longstr", "name": "response"},
119
+ {"type": "shortstr", "name": "locale"}],
120
+ "name": "start-ok"},
121
+ {"id": 20,
122
+ "arguments": [{"type": "longstr", "name": "challenge"}],
123
+ "name": "secure"},
124
+ {"id": 21,
125
+ "arguments": [{"type": "longstr", "name": "response"}],
126
+ "name": "secure-ok"},
127
+ {"id": 30,
128
+ "arguments": [{"type": "short", "name": "channel-max"},
129
+ {"type": "long", "name": "frame-max"},
130
+ {"type": "short", "name": "heartbeat"}],
131
+ "name": "tune"},
132
+ {"id": 31,
133
+ "arguments": [{"type": "short", "name": "channel-max"},
134
+ {"type": "long", "name": "frame-max"},
135
+ {"type": "short", "name": "heartbeat"}],
136
+ "name": "tune-ok"},
137
+ {"id": 40,
138
+ "arguments": [{"type": "shortstr", "name": "virtual-host"},
139
+ {"type": "shortstr", "name": "capabilities"},
140
+ {"type": "bit", "name": "insist"}],
141
+ "name": "open"},
142
+ {"id": 41,
143
+ "arguments": [{"type": "shortstr", "name": "known-hosts"}],
144
+ "name": "open-ok"},
145
+ {"id": 50,
146
+ "arguments": [{"type": "shortstr", "name": "host"},
147
+ {"type": "shortstr", "name": "known-hosts"}],
148
+ "name": "redirect"},
149
+ {"id": 60,
150
+ "arguments": [{"type": "short", "name": "reply-code"},
151
+ {"type": "shortstr", "name": "reply-text"},
152
+ {"type": "short", "name": "class-id"},
153
+ {"type": "short", "name": "method-id"}],
154
+ "name": "close"},
155
+ {"id": 61,
156
+ "arguments": [],
157
+ "name": "close-ok"}],
158
+ "name": "connection",
159
+ "properties": []
160
+ },
161
+ {
162
+ "id": 20,
163
+ "methods": [{"id": 10,
164
+ "arguments": [{"type": "shortstr", "name": "out-of-band"}],
165
+ "name": "open"},
166
+ {"id": 11,
167
+ "arguments": [],
168
+ "name": "open-ok"},
169
+ {"id": 20,
170
+ "arguments": [{"type": "bit", "name": "active"}],
171
+ "name": "flow"},
172
+ {"id": 21,
173
+ "arguments": [{"type": "bit", "name": "active"}],
174
+ "name": "flow-ok"},
175
+ {"id": 30,
176
+ "arguments": [{"type": "short", "name": "reply-code"},
177
+ {"type": "shortstr", "name": "reply-text"},
178
+ {"type": "table", "name": "details"}],
179
+ "name": "alert"},
180
+ {"id": 40,
181
+ "arguments": [{"type": "short", "name": "reply-code"},
182
+ {"type": "shortstr", "name": "reply-text"},
183
+ {"type": "short", "name": "class-id"},
184
+ {"type": "short", "name": "method-id"}],
185
+ "name": "close"},
186
+ {"id": 41,
187
+ "arguments": [],
188
+ "name": "close-ok"}],
189
+ "name": "channel"
190
+ },
191
+ {
192
+ "id": 30,
193
+ "methods": [{"id": 10,
194
+ "arguments": [{"type": "shortstr", "name": "realm"},
195
+ {"type": "bit", "name": "exclusive"},
196
+ {"type": "bit", "name": "passive"},
197
+ {"type": "bit", "name": "active"},
198
+ {"type": "bit", "name": "write"},
199
+ {"type": "bit", "name": "read"}],
200
+ "name": "request"},
201
+ {"id": 11,
202
+ "arguments": [{"type": "short", "name": "ticket"}],
203
+ "name": "request-ok"}],
204
+ "name": "access"
205
+ },
206
+ {
207
+ "id": 40,
208
+ "methods": [{"id": 10,
209
+ "arguments": [{"type": "short", "name": "ticket"},
210
+ {"type": "shortstr", "name": "exchange"},
211
+ {"type": "shortstr", "name": "type"},
212
+ {"type": "bit", "name": "passive"},
213
+ {"type": "bit", "name": "durable"},
214
+ {"type": "bit", "name": "auto-delete"},
215
+ {"type": "bit", "name": "internal"},
216
+ {"type": "bit", "name": "nowait"},
217
+ {"type": "table", "name": "arguments"}],
218
+ "name": "declare"},
219
+ {"id": 11,
220
+ "arguments": [],
221
+ "name": "declare-ok"},
222
+ {"id": 20,
223
+ "arguments": [{"type": "short", "name": "ticket"},
224
+ {"type": "shortstr", "name": "exchange"},
225
+ {"type": "bit", "name": "if-unused"},
226
+ {"type": "bit", "name": "nowait"}],
227
+ "name": "delete"},
228
+ {"id": 21,
229
+ "arguments": [],
230
+ "name": "delete-ok"}],
231
+ "name": "exchange"
232
+ },
233
+ {
234
+ "id": 50,
235
+ "methods": [{"id": 10,
236
+ "arguments": [{"type": "short", "name": "ticket"},
237
+ {"type": "shortstr", "name": "queue"},
238
+ {"type": "bit", "name": "passive"},
239
+ {"type": "bit", "name": "durable"},
240
+ {"type": "bit", "name": "exclusive"},
241
+ {"type": "bit", "name": "auto-delete"},
242
+ {"type": "bit", "name": "nowait"},
243
+ {"type": "table", "name": "arguments"}],
244
+ "name": "declare"},
245
+ {"id": 11,
246
+ "arguments": [{"type": "shortstr", "name": "queue"},
247
+ {"type": "long", "name": "message-count"},
248
+ {"type": "long", "name": "consumer-count"}],
249
+ "name": "declare-ok"},
250
+ {"id": 20,
251
+ "arguments": [{"type": "short", "name": "ticket"},
252
+ {"type": "shortstr", "name": "queue"},
253
+ {"type": "shortstr", "name": "exchange"},
254
+ {"type": "shortstr", "name": "routing-key"},
255
+ {"type": "bit", "name": "nowait"},
256
+ {"type": "table", "name": "arguments"}],
257
+ "name": "bind"},
258
+ {"id": 21,
259
+ "arguments": [],
260
+ "name": "bind-ok"},
261
+ {"id": 30,
262
+ "arguments": [{"type": "short", "name": "ticket"},
263
+ {"type": "shortstr", "name": "queue"},
264
+ {"type": "bit", "name": "nowait"}],
265
+ "name": "purge"},
266
+ {"id": 31,
267
+ "arguments": [{"type": "long", "name": "message-count"}],
268
+ "name": "purge-ok"},
269
+ {"id": 40,
270
+ "arguments": [{"type": "short", "name": "ticket"},
271
+ {"type": "shortstr", "name": "queue"},
272
+ {"type": "bit", "name": "if-unused"},
273
+ {"type": "bit", "name": "if-empty"},
274
+ {"type": "bit", "name": "nowait"}],
275
+ "name": "delete"},
276
+ {"id": 41,
277
+ "arguments": [{"type": "long", "name": "message-count"}],
278
+ "name": "delete-ok"},
279
+ {"id": 50,
280
+ "arguments": [{"type": "short", "name": "ticket"},
281
+ {"type": "shortstr", "name": "queue"},
282
+ {"type": "shortstr", "name": "exchange"},
283
+ {"type": "shortstr", "name": "routing-key"},
284
+ {"type": "table", "name": "arguments"}],
285
+ "name": "unbind"},
286
+ {"id": 51,
287
+ "arguments": [],
288
+ "name": "unbind-ok"}
289
+ ],
290
+ "name": "queue"
291
+ },
292
+ {
293
+ "id": 60,
294
+ "methods": [{"id": 10,
295
+ "arguments": [{"type": "long", "name": "prefetch-size"},
296
+ {"type": "short", "name": "prefetch-count"},
297
+ {"type": "bit", "name": "global"}],
298
+ "name": "qos"},
299
+ {"id": 11,
300
+ "arguments": [],
301
+ "name": "qos-ok"},
302
+ {"id": 20,
303
+ "arguments": [{"domain": "access-ticket", "name": "ticket"},
304
+ {"domain": "queue-name", "name": "queue"},
305
+ {"type": "shortstr", "name": "consumer-tag"},
306
+ {"type": "bit", "name": "no-local"},
307
+ {"type": "bit", "name": "no-ack"},
308
+ {"type": "bit", "name": "exclusive"},
309
+ {"type": "bit", "name": "nowait"}],
310
+ "name": "consume"},
311
+ {"id": 21,
312
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
313
+ "name": "consume-ok"},
314
+ {"id": 30,
315
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
316
+ {"type": "bit", "name": "nowait"}],
317
+ "name": "cancel"},
318
+ {"id": 31,
319
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
320
+ "name": "cancel-ok"},
321
+ {"content": true,
322
+ "id": 40,
323
+ "arguments": [{"type": "short", "name": "ticket"},
324
+ {"type": "shortstr", "name": "exchange"},
325
+ {"type": "shortstr", "name": "routing-key"},
326
+ {"type": "bit", "name": "mandatory"},
327
+ {"type": "bit", "name": "immediate"}],
328
+ "name": "publish"},
329
+ {"content": true,
330
+ "id": 50,
331
+ "arguments": [{"type": "short", "name": "reply-code"},
332
+ {"type": "shortstr", "name": "reply-text"},
333
+ {"type": "shortstr", "name": "exchange"},
334
+ {"type": "shortstr", "name": "routing-key"}],
335
+ "name": "return"},
336
+ {"content": true,
337
+ "id": 60,
338
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
339
+ {"type": "longlong", "name": "delivery-tag"},
340
+ {"type": "bit", "name": "redelivered"},
341
+ {"type": "shortstr", "name": "exchange"},
342
+ {"type": "shortstr", "name": "routing-key"}],
343
+ "name": "deliver"},
344
+ {"id": 70,
345
+ "arguments": [{"type": "short", "name": "ticket"},
346
+ {"type": "shortstr", "name": "queue"},
347
+ {"type": "bit", "name": "no-ack"}],
348
+ "name": "get"},
349
+ {"content": true,
350
+ "id": 71,
351
+ "arguments": [{"type": "longlong", "name": "delivery-tag"},
352
+ {"type": "bit", "name": "redelivered"},
353
+ {"type": "shortstr", "name": "exchange"},
354
+ {"type": "shortstr", "name": "routing-key"},
355
+ {"type": "long", "name": "message-count"}],
356
+ "name": "get-ok"},
357
+ {"id": 72,
358
+ "arguments": [{"type": "shortstr", "name": "cluster-id"}],
359
+ "name": "get-empty"},
360
+ {"id": 80,
361
+ "arguments": [{"type": "longlong", "name": "delivery-tag"},
362
+ {"type": "bit", "name": "multiple"}],
363
+ "name": "ack"},
364
+ {"id": 90,
365
+ "arguments": [{"type": "longlong", "name": "delivery-tag"},
366
+ {"type": "bit", "name": "requeue"}],
367
+ "name": "reject"},
368
+ {"id": 100,
369
+ "arguments": [{"type": "bit", "name": "requeue"}],
370
+ "name": "recover"}],
371
+ "name": "basic",
372
+ "properties": [{"type": "shortstr", "name": "content-type"},
373
+ {"type": "shortstr", "name": "content-encoding"},
374
+ {"type": "table", "name": "headers"},
375
+ {"type": "octet", "name": "delivery-mode"},
376
+ {"type": "octet", "name": "priority"},
377
+ {"type": "shortstr", "name": "correlation-id"},
378
+ {"type": "shortstr", "name": "reply-to"},
379
+ {"type": "shortstr", "name": "expiration"},
380
+ {"type": "shortstr", "name": "message-id"},
381
+ {"type": "timestamp", "name": "timestamp"},
382
+ {"type": "shortstr", "name": "type"},
383
+ {"type": "shortstr", "name": "user-id"},
384
+ {"type": "shortstr", "name": "app-id"},
385
+ {"type": "shortstr", "name": "cluster-id"}]
386
+ },
387
+ {
388
+ "id": 70,
389
+ "methods": [{"id": 10,
390
+ "arguments": [{"type": "long", "name": "prefetch-size"},
391
+ {"type": "short", "name": "prefetch-count"},
392
+ {"type": "bit", "name": "global"}],
393
+ "name": "qos"},
394
+ {"id": 11,
395
+ "arguments": [],
396
+ "name": "qos-ok"},
397
+ {"id": 20,
398
+ "arguments": [{"type": "short", "name": "ticket"},
399
+ {"type": "shortstr", "name": "queue"},
400
+ {"type": "shortstr", "name": "consumer-tag"},
401
+ {"type": "bit", "name": "no-local"},
402
+ {"type": "bit", "name": "no-ack"},
403
+ {"type": "bit", "name": "exclusive"},
404
+ {"type": "bit", "name": "nowait"}],
405
+ "name": "consume"},
406
+ {"id": 21,
407
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
408
+ "name": "consume-ok"},
409
+ {"id": 30,
410
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
411
+ {"type": "bit", "name": "nowait"}],
412
+ "name": "cancel"},
413
+ {"id": 31,
414
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
415
+ "name": "cancel-ok"},
416
+ {"id": 40,
417
+ "arguments": [{"type": "shortstr", "name": "identifier"},
418
+ {"type": "longlong", "name": "content-size"}],
419
+ "name": "open"},
420
+ {"id": 41,
421
+ "arguments": [{"type": "longlong", "name": "staged-size"}],
422
+ "name": "open-ok"},
423
+ {"content": true,
424
+ "id": 50,
425
+ "arguments": [],
426
+ "name": "stage"},
427
+ {"id": 60,
428
+ "arguments": [{"type": "short", "name": "ticket"},
429
+ {"type": "shortstr", "name": "exchange"},
430
+ {"type": "shortstr", "name": "routing-key"},
431
+ {"type": "bit", "name": "mandatory"},
432
+ {"type": "bit", "name": "immediate"},
433
+ {"type": "shortstr", "name": "identifier"}],
434
+ "name": "publish"},
435
+ {"content": true,
436
+ "id": 70,
437
+ "arguments": [{"type": "short", "name": "reply-code"},
438
+ {"type": "shortstr", "name": "reply-text"},
439
+ {"type": "shortstr", "name": "exchange"},
440
+ {"type": "shortstr", "name": "routing-key"}],
441
+ "name": "return"},
442
+ {"id": 80,
443
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
444
+ {"type": "longlong", "name": "delivery-tag"},
445
+ {"type": "bit", "name": "redelivered"},
446
+ {"type": "shortstr", "name": "exchange"},
447
+ {"type": "shortstr", "name": "routing-key"},
448
+ {"type": "shortstr", "name": "identifier"}],
449
+ "name": "deliver"},
450
+ {"id": 90,
451
+ "arguments": [{"type": "longlong", "name": "delivery-tag"},
452
+ {"type": "bit", "name": "multiple"}],
453
+ "name": "ack"},
454
+ {"id": 100,
455
+ "arguments": [{"type": "longlong", "name": "delivery-tag"},
456
+ {"type": "bit", "name": "requeue"}],
457
+ "name": "reject"}],
458
+ "name": "file",
459
+ "properties": [{"type": "shortstr", "name": "content-type"},
460
+ {"type": "shortstr", "name": "content-encoding"},
461
+ {"type": "table", "name": "headers"},
462
+ {"type": "octet", "name": "priority"},
463
+ {"type": "shortstr", "name": "reply-to"},
464
+ {"type": "shortstr", "name": "message-id"},
465
+ {"type": "shortstr", "name": "filename"},
466
+ {"type": "timestamp", "name": "timestamp"},
467
+ {"type": "shortstr", "name": "cluster-id"}]
468
+ },
469
+ {
470
+ "id": 80,
471
+ "methods": [{"id": 10,
472
+ "arguments": [{"type": "long", "name": "prefetch-size"},
473
+ {"type": "short", "name": "prefetch-count"},
474
+ {"type": "long", "name": "consume-rate"},
475
+ {"type": "bit", "name": "global"}],
476
+ "name": "qos"},
477
+ {"id": 11,
478
+ "arguments": [],
479
+ "name": "qos-ok"},
480
+ {"id": 20,
481
+ "arguments": [{"type": "short", "name": "ticket"},
482
+ {"type": "shortstr", "name": "queue"},
483
+ {"type": "shortstr", "name": "consumer-tag"},
484
+ {"type": "bit", "name": "no-local"},
485
+ {"type": "bit", "name": "exclusive"},
486
+ {"type": "bit", "name": "nowait"}],
487
+ "name": "consume"},
488
+ {"id": 21,
489
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
490
+ "name": "consume-ok"},
491
+ {"id": 30,
492
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
493
+ {"type": "bit", "name": "nowait"}],
494
+ "name": "cancel"},
495
+ {"id": 31,
496
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"}],
497
+ "name": "cancel-ok"},
498
+ {"content": true,
499
+ "id": 40,
500
+ "arguments": [{"type": "short", "name": "ticket"},
501
+ {"type": "shortstr", "name": "exchange"},
502
+ {"type": "shortstr", "name": "routing-key"},
503
+ {"type": "bit", "name": "mandatory"},
504
+ {"type": "bit", "name": "immediate"}],
505
+ "name": "publish"},
506
+ {"content": true,
507
+ "id": 50,
508
+ "arguments": [{"type": "short", "name": "reply-code"},
509
+ {"type": "shortstr", "name": "reply-text"},
510
+ {"type": "shortstr", "name": "exchange"},
511
+ {"type": "shortstr", "name": "routing-key"}],
512
+ "name": "return"},
513
+ {"content": true,
514
+ "id": 60,
515
+ "arguments": [{"type": "shortstr", "name": "consumer-tag"},
516
+ {"type": "longlong", "name": "delivery-tag"},
517
+ {"type": "shortstr", "name": "exchange"},
518
+ {"type": "shortstr", "name": "queue"}],
519
+ "name": "deliver"}],
520
+ "name": "stream",
521
+ "properties": [{"type": "shortstr", "name": "content-type"},
522
+ {"type": "shortstr", "name": "content-encoding"},
523
+ {"type": "table", "name": "headers"},
524
+ {"type": "octet", "name": "priority"},
525
+ {"type": "timestamp", "name": "timestamp"}]
526
+ },
527
+ {
528
+ "id": 90,
529
+ "methods": [{"id": 10,
530
+ "arguments": [],
531
+ "name": "select"},
532
+ {"id": 11,
533
+ "arguments": [],
534
+ "name": "select-ok"},
535
+ {"id": 20,
536
+ "arguments": [],
537
+ "name": "commit"},
538
+ {"id": 21,
539
+ "arguments": [],
540
+ "name": "commit-ok"},
541
+ {"id": 30,
542
+ "arguments": [],
543
+ "name": "rollback"},
544
+ {"id": 31,
545
+ "arguments": [],
546
+ "name": "rollback-ok"}],
547
+ "name": "tx"
548
+ },
549
+ {
550
+ "id": 100,
551
+ "methods": [{"id": 10,
552
+ "arguments": [],
553
+ "name": "select"},
554
+ {"id": 11,
555
+ "arguments": [],
556
+ "name": "select-ok"},
557
+ {"id": 20,
558
+ "arguments": [{"type": "shortstr", "name": "dtx-identifier"}],
559
+ "name": "start"},
560
+ {"id": 21,
561
+ "arguments": [], "name": "start-ok"}],
562
+ "name": "dtx"
563
+ },
564
+ {
565
+ "id": 110,
566
+ "methods": [{"content": true,
567
+ "id": 10,
568
+ "arguments": [{"type": "table", "name": "meta-data"}],
569
+ "name": "request"}],
570
+ "name": "tunnel",
571
+ "properties": [{"type": "table", "name": "headers"},
572
+ {"type": "shortstr", "name": "proxy-name"},
573
+ {"type": "shortstr", "name": "data-name"},
574
+ {"type": "octet", "name": "durable"},
575
+ {"type": "octet", "name": "broadcast"}]
576
+ },
577
+ {
578
+ "id": 120,
579
+ "methods": [{"id": 10,
580
+ "arguments": [{"type": "octet", "name": "integer-1"},
581
+ {"type": "short", "name": "integer-2"},
582
+ {"type": "long", "name": "integer-3"},
583
+ {"type": "longlong", "name": "integer-4"},
584
+ {"type": "octet", "name": "operation"}],
585
+ "name": "integer"},
586
+ {"id": 11,
587
+ "arguments": [{"type": "longlong", "name": "result"}],
588
+ "name": "integer-ok"},
589
+ {"id": 20,
590
+ "arguments": [{"type": "shortstr", "name": "string-1"},
591
+ {"type": "longstr", "name": "string-2"},
592
+ {"type": "octet", "name": "operation"}],
593
+ "name": "string"},
594
+ {"id": 21,
595
+ "arguments": [{"type": "longstr", "name": "result"}],
596
+ "name": "string-ok"},
597
+ {"id": 30,
598
+ "arguments": [{"type": "table", "name": "table"},
599
+ {"type": "octet", "name": "integer-op"},
600
+ {"type": "octet", "name": "string-op"}],
601
+ "name": "table"},
602
+ {"id": 31,
603
+ "arguments": [{"type": "longlong", "name": "integer-result"},
604
+ {"type": "longstr", "name": "string-result"}],
605
+ "name": "table-ok"},
606
+ {"content": true,
607
+ "id": 40,
608
+ "arguments": [],
609
+ "name": "content"},
610
+ {"content": true,
611
+ "id": 41,
612
+ "arguments": [{"type": "long", "name": "content-checksum"}],
613
+ "name": "content-ok"}],
614
+ "name": "test"
615
+ }
616
+ ]
617
+ }