aboutsummaryrefslogtreecommitdiffstats
path: root/_sources/protocol.txt
diff options
context:
space:
mode:
Diffstat (limited to '_sources/protocol.txt')
-rw-r--r--_sources/protocol.txt118
1 files changed, 71 insertions, 47 deletions
diff --git a/_sources/protocol.txt b/_sources/protocol.txt
index c341403..44544d6 100644
--- a/_sources/protocol.txt
+++ b/_sources/protocol.txt
@@ -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.
@@ -204,16 +215,29 @@ Heartbeating
204 * If the broker detects that a worker has disconnected it should stop sending it a message of any type. 215 * If the broker detects that a worker has disconnected it should stop sending it a message of any type.
205 * If the scheduler detects that the broker disconnects it SHOULD restart the conversation. 216 * If the scheduler detects that the broker disconnects it SHOULD restart the conversation.
206 217
207REQUEST Headers 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
213=============== ======= ======= ======= =========== 224
214Header REQUEST PUBLISH Default Description 225================= ======= ======= ======== ======= ===========
215=============== ======= ======= ======= =========== 226Header REQUEST PUBLISH SCHEDULE Default Description
216reply-requested X False Once the job is finished, send a reply back with information from the job. If there is no information reply with a True value. 227================= ======= ======= ======== ======= ===========
217retry-count:# X 0 Retry a failed job this many times before accepting defeat. 228reply-requested X False Once the job is finished, send a reply back with information from the job. If there is no information reply with a True value.
218guarantee X False Ensure the job completes by letting someone else worry about a success reply. 229retry-count:# X 0 Retry a failed job this many times before accepting defeat.
219=============== ======= ======= ======= =========== 230guarantee X False Ensure the job completes by letting someone else worry about a success reply.
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.
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.