1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
|
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>EventMQ Protocol Specification — EventMQ 0 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="top" title="EventMQ 0 documentation" href="index.html"/>
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav" role="document">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> EventMQ
</a>
<div class="version">
0
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul>
<li class="toctree-l1"><a class="reference internal" href="jobmanager.html"><code class="docutils literal"><span class="pre">jobmanager</span></code> – Job Manager</a></li>
<li class="toctree-l1"><a class="reference internal" href="receiver.html"><code class="docutils literal"><span class="pre">receiver</span></code> – Receiver</a></li>
<li class="toctree-l1"><a class="reference internal" href="router.html"><code class="docutils literal"><span class="pre">router</span></code> – Router</a></li>
<li class="toctree-l1"><a class="reference internal" href="sender.html"><code class="docutils literal"><span class="pre">sender</span></code> – Sender</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" role="navigation" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">EventMQ</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> »</li>
<li>EventMQ Protocol Specification</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/protocol.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="eventmq-protocol-specification">
<h1>EventMQ Protocol Specification<a class="headerlink" href="#eventmq-protocol-specification" title="Permalink to this headline">¶</a></h1>
<p><em>The status of this document is alpha and subject to heavy change</em></p>
</div>
<div class="section" id="goals">
<h1>Goals<a class="headerlink" href="#goals" title="Permalink to this headline">¶</a></h1>
<p>The EventMQ Protocol (eMQP) defines a reliable service-oriented request-reply and pub-sub dialog between a set of clients, a broker, and a set of workers. This goal is to</p>
<p>The goals are to:</p>
<blockquote>
<div><ul class="simple">
<li>Specify a protocol to follow when implementing a component to EventMQ.</li>
<li>Allow requests to be routed to workers by an abstracted service name.</li>
<li>Detect disconnected peers through heartbeating.</li>
<li>Allow for message tracing and debugging.</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="license">
<h1>License<a class="headerlink" href="#license" title="Permalink to this headline">¶</a></h1>
<p>This Specification is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>
<p>This Specification is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>
</div>
<div class="section" id="language">
<h1>Language<a class="headerlink" href="#language" title="Permalink to this headline">¶</a></h1>
<p>The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119[[1](<a class="reference external" href="http://tools.ietf.org/html/rfc2119">http://tools.ietf.org/html/rfc2119</a>)].</p>
</div>
<div class="section" id="architecture">
<h1>Architecture<a class="headerlink" href="#architecture" title="Permalink to this headline">¶</a></h1>
<p>insert pretty picture here</p>
<div class="section" id="topology">
<h2>Topology<a class="headerlink" href="#topology" title="Permalink to this headline">¶</a></h2>
<p>eMQP connects a set of client applications (e.g. web servers), a broker, and a pool of workers. Clients connect to the broker as well as the workers.</p>
<p>‘Clients’ is defined as application issuing requests and ‘workers’ as applications that process these requests. (Workers consist of a <cite>JobManager</cite> and a pool of <cite>Worker</cite> resources where the job executes.)</p>
<p>The EventMQ broker handles a set of named queues. The broker SHOULD serve clients on a fair request and MAY deliver requests to workers on any basis, including 0MQ’s built-in round robin or least-recently used.</p>
</div>
<div class="section" id="router-addressing">
<h2>ROUTER Addressing<a class="headerlink" href="#router-addressing" title="Permalink to this headline">¶</a></h2>
<p>In the case of request-reply, the broker MUST use a ROUTER socket to accept requests from both clients and workers. The broker MAY use a seperate socket implementing a subset of eMQP, or MAY use a single socket implementing all of eMQP.</p>
<p>From the 0MQ manual[[2](<a class="reference external" href="http://api.zeromq.org/master:zmq-socket">http://api.zeromq.org/master:zmq-socket</a>)]
> When receiving messages a ROUTER socket shall prepend a message part containing the identity of the originating peer to the message before passing it to the application. When sending messages a ROUTER socket shall remove the first part of the message and use it to determine the identity of the peer the message shall be routed to.</p>
<p>This extra frame is not shown in the specifications below.</p>
</div>
<div class="section" id="emqp-client">
<h2>eMQP / Client<a class="headerlink" href="#emqp-client" title="Permalink to this headline">¶</a></h2>
<p>A <strong>REQUEST</strong> command consists of 7-frame multipart message, formatted as follows.</p>
<table border="1" class="docutils">
<colgroup>
<col width="10%" />
<col width="22%" />
<col width="68%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>READY</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
<tr class="row-even"><td>4</td>
<td>_QUEUE_NAME_</td>
<td>the name of the queue the worker belongs to</td>
</tr>
<tr class="row-odd"><td>5</td>
<td>_HEADERS_</td>
<td>dictionary of headers. can be an empty set</td>
</tr>
<tr class="row-even"><td>6</td>
<td>_MSG_</td>
<td>The message to send</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="emqp-worker">
<h2>eMQP / Worker<a class="headerlink" href="#emqp-worker" title="Permalink to this headline">¶</a></h2>
<p>An <strong>INFORM</strong> command consists of a 5-frame multipart message, formatted as follows.</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="20%" />
<col width="71%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>INFORM</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
<tr class="row-even"><td>4</td>
<td>_QUEUE_NAME_</td>
<td>csv seperated names of queue the worker belongs to</td>
</tr>
</tbody>
</table>
<p>A <strong>READY</strong> frame consists of a 4-frame multipart message, formatted as follows.</p>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="33%" />
<col width="53%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>READY</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
</tbody>
</table>
<p>A <strong>REPLY</strong> frame consists of a 5-frame multipart message, formatted as follows.</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="31%" />
<col width="56%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>REPLY</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
<tr class="row-even"><td>4</td>
<td>_MSG_</td>
<td>The reply to respond with</td>
</tr>
</tbody>
</table>
<p>A <strong>HEARTBEAT</strong> frame consists of a</p>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="33%" />
<col width="53%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>HEARTBEAT</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
</tbody>
</table>
<p>A <strong>DISCONNECT</strong> frame consists of</p>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="33%" />
<col width="53%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">FRAME</th>
<th class="head">Value</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>0</td>
<td>_EMPTY_</td>
<td>leave empty</td>
</tr>
<tr class="row-odd"><td>1</td>
<td>eMQP/1.0</td>
<td>Protocol version</td>
</tr>
<tr class="row-even"><td>2</td>
<td>DISCONNECT</td>
<td>command</td>
</tr>
<tr class="row-odd"><td>3</td>
<td>_MSGID_</td>
<td>A unique id for the msg</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="heartbeating">
<h2>Heartbeating<a class="headerlink" href="#heartbeating" title="Permalink to this headline">¶</a></h2>
<blockquote>
<div><ul class="simple">
<li>HEARTBEAT commands are valid at any time after an INFORM command</li>
<li>Any command except DISCONNECT act as a heartbeat. Peers SHOULD NOT send HEARTBEAT commands while sending other commands.</li>
<li>Both worker and broker MUST send heartbeats at regular and agreed-upon intervals.</li>
<li>If the worker detects that the broker disconnected it SHOULD restart the conversation.</li>
<li>If the broker detects that a worker has disconnected it should stop sending it a message of any type.</li>
</ul>
</div></blockquote>
</div>
</div>
</div>
</div>
<footer>
<hr/>
<div role="contentinfo">
<p>
© Copyright 2015, eventboard.io.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/snide/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'0',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.StickyNav.enable();
});
</script>
</body>
</html>
|