aboutsummaryrefslogtreecommitdiffstats
path: root/protocol.html
blob: 196bb80f9628c6a13c3fcc654a465bb0cba60154 (plain) (blame)
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>EventMQ Protocol Specification &mdash; EventMQ 0 documentation</title>
    
    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    
    <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>
    <link rel="top" title="EventMQ 0 documentation" href="index.html" /> 
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <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 &#8220;MUST&#8221;, &#8220;MUST NOT&#8221;, &#8220;REQUIRED&#8221;, &#8220;SHALL&#8221;, &#8220;SHALL NOT&#8221;, &#8220;SHOULD&#8221;, &#8220;SHOULD NOT&#8221;, &#8220;RECOMMENDED&#8221;, &#8220;MAY&#8221;, and &#8220;OPTIONAL&#8221; 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>&#8216;Clients&#8217; is defined as application issuing requests and &#8216;workers&#8217; 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&#8217;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>)]
&gt; 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="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>INFORM</td>
<td>&nbsp;</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>
</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>&nbsp;</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>&nbsp;</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>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">EventMQ Protocol Specification</a></li>
<li><a class="reference internal" href="#goals">Goals</a></li>
<li><a class="reference internal" href="#license">License</a></li>
<li><a class="reference internal" href="#language">Language</a></li>
<li><a class="reference internal" href="#architecture">Architecture</a><ul>
<li><a class="reference internal" href="#topology">Topology</a></li>
<li><a class="reference internal" href="#router-addressing">ROUTER Addressing</a></li>
<li><a class="reference internal" href="#emqp-client">eMQP / Client</a></li>
<li><a class="reference internal" href="#emqp-worker">eMQP / Worker</a></li>
</ul>
</li>
</ul>

  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/protocol.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">EventMQ 0 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &copy; Copyright 2015, eventboard.io.
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.3.1.
    </div>
  </body>
</html>