aboutsummaryrefslogtreecommitdiffstats
path: root/docs/protocol.rst
diff options
context:
space:
mode:
authorjason2016-09-08 16:37:57 -0600
committerjason2016-09-08 16:49:19 -0600
commit1ce509b6b6749667f5fb3313a93393390aef3231 (patch)
tree96409e22d8dcf18df33f00a8b31dc0fec708efcd /docs/protocol.rst
parent6cc42a22db501bc175c977c514951ae8e37236cf (diff)
downloadeventmq-1ce509b6b6749667f5fb3313a93393390aef3231.tar.gz
eventmq-1ce509b6b6749667f5fb3313a93393390aef3231.zip
Stub of emq-cli
- starts emq-cli and implements status for the router
Diffstat (limited to 'docs/protocol.rst')
-rw-r--r--docs/protocol.rst101
1 files changed, 62 insertions, 39 deletions
diff --git a/docs/protocol.rst b/docs/protocol.rst
index bf400cc..44544d6 100644
--- a/docs/protocol.rst
+++ b/docs/protocol.rst
@@ -5,12 +5,12 @@ EventMQ Protocol Specification
5 5
6Goals 6Goals
7===== 7=====
8The 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 8The 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.
9 9
10The goals are to: 10The goals are to:
11 11
12 * Specify a protocol to follow when implementing a component to EventMQ. 12 * Specify a protocol to follow when implementing a component to EventMQ.
13 * Allow requests to be routed to workers by an abstracted service name. 13 * Allow requests to be routed to workers by an abstracted service name (named queues).
14 * Detect disconnected peers through heartbeating. 14 * Detect disconnected peers through heartbeating.
15 * Allow for message tracing and debugging. 15 * Allow for message tracing and debugging.
16 16
@@ -60,6 +60,52 @@ FRAME Value Description
604 _MSGID_ The message id of the message this ACK is acknowledging 604 _MSGID_ The message id of the message this ACK is acknowledging
61====== ============== =========== 61====== ============== ===========
62 62
63A **REPLY** frame consists of a 5-frame multipart message, formatted as follows.
64
65====== ============== ===========
66FRAME Value Description
67====== ============== ===========
680 _EMPTY_ leave empty
691 eMQP/1.0 Protocol version
702 REPLY command
713 _MSGID_ A unique id for the msg
724 _MSG_ The reply to respond with
73====== ============== ===========
74
75A **HEARTBEAT** frame consists of a
76
77====== ============== ===========
78FRAME Value Description
79====== ============== ===========
800 _EMPTY_ leave empty
811 eMQP/1.0 Protocol version
822 HEARTBEAT command
833 _MSGID_ A unique id for the msg
844 _UNIX_TS_ A unix timestamp
85====== ============== ===========
86
87A **DISCONNECT** frame consists of
88
89====== ============== ===========
90FRAME Value Description
91====== ============== ===========
920 _EMPTY_ leave empty
931 eMQP/1.0 Protocol version
942 DISCONNECT command
953 _MSGID_ A unique id for the msg
96====== ============== ===========
97
98A **KBAI** frame consists of
99
100====== ============== ===========
101FRAME Value Description
102====== ============== ===========
1030 _EMPTY_ leave empty
1041 eMQP/1.0 Protocol version
1052 KBAI command
1063 _MSGID_ A unique id for the msg
107====== ============== ===========
108
63eMQP / Client 109eMQP / Client
64------------- 110-------------
65A **REQUEST** command consists of a 7-frame multipart message, formatted as follows. 111A **REQUEST** command consists of a 7-frame multipart message, formatted as follows.
@@ -159,44 +205,9 @@ FRAME Value Description
1593 _MSGID_ A unique id for the msg 2053 _MSGID_ A unique id for the msg
160====== ============== =========== 206====== ============== ===========
161 207
162A **REPLY** frame consists of a 5-frame multipart message, formatted as follows.
163
164====== ============== ===========
165FRAME Value Description
166====== ============== ===========
1670 _EMPTY_ leave empty
1681 eMQP/1.0 Protocol version
1692 REPLY command
1703 _MSGID_ A unique id for the msg
1714 _MSG_ The reply to respond with
172====== ============== ===========
173
174A **HEARTBEAT** frame consists of a
175
176====== ============== ===========
177FRAME Value Description
178====== ============== ===========
1790 _EMPTY_ leave empty
1801 eMQP/1.0 Protocol version
1812 HEARTBEAT command
1823 _MSGID_ A unique id for the msg
1834 _UNIX_TS_ A unix timestamp
184====== ============== ===========
185
186A **DISCONNECT** frame consists of
187
188====== ============== ===========
189FRAME Value Description
190====== ============== ===========
1910 _EMPTY_ leave empty
1921 eMQP/1.0 Protocol version
1932 DISCONNECT command
1943 _MSGID_ A unique id for the msg
195====== ============== ===========
196
197Heartbeating 208Heartbeating
198------------ 209------------
199 * HEARTBEAT commands are valid at any time after an INFORM command 210 * HEARTBEAT commands are valid at any time after an INFORM command.
200 * Any command except DISCONNECT act as a heartbeat. Peers SHOULD NOT send HEARTBEAT commands while sending other commands. 211 * Any command except DISCONNECT act as a heartbeat. Peers SHOULD NOT send HEARTBEAT commands while sending other commands.
201 * Worker and broker MUST send heartbeats at regular and agreed-upon intervals. 212 * Worker and broker MUST send heartbeats at regular and agreed-upon intervals.
202 * Scheduler and broker MUST send heartbeats at regular and agreed-upon intervals. 213 * Scheduler and broker MUST send heartbeats at regular and agreed-upon intervals.
@@ -206,10 +217,11 @@ Heartbeating
206 217
207Headers 218Headers
208--------------- 219---------------
209Headers MUST be 0 to many comma seperated values inserted into the header field. If there are no headers required, send an empty string MUST be sent where headers are required. 220Headers MUST be 0 to many comma seperated values inserted into the header field. If there are no headers required, an empty string MUST be sent where headers are required.
210 221
211Below is a table which defines and describes the headers. 222Below is a table which defines and describes the headers.
212 223
224
213================= ======= ======= ======== ======= =========== 225================= ======= ======= ======== ======= ===========
214Header REQUEST PUBLISH SCHEDULE Default Description 226Header REQUEST PUBLISH SCHEDULE Default Description
215================= ======= ======= ======== ======= =========== 227================= ======= ======= ======== ======= ===========
@@ -218,3 +230,14 @@ retry-count:# X 0 Retry a failed job this many
218guarantee X False Ensure the job completes by letting someone else worry about a success reply. 230guarantee X False Ensure the job completes by letting someone else worry about a success reply.
219nohaste X False When scheduling a job, set this to True if you don't want the job to run immediately as it's scheduled. Instead, it will run for the first time when the interval has elapsed. 231nohaste X False When scheduling a job, set this to True if you don't want the job to run immediately as it's scheduled. Instead, it will run for the first time when the interval has elapsed.
220================= ======= ======= ======== ======= =========== 232================= ======= ======= ======== ======= ===========
233
234DISCONNECT and KBAI
235===================
236When a component receives a DISCONNECT command it:
237 * MUST send a KBAI command to all connected components.
238 * MUST stop sending and receiving any messages
239 * MUST allow any pending messages or jobs to complete.
240
241When a component receives a KBAI command it:
242 * MUST stop sending any messages to the disconnecting component.
243 * SHOULD Clean up references to the disconnecting component.