diff options
| author | jason | 2016-09-08 16:37:57 -0600 |
|---|---|---|
| committer | jason | 2016-09-08 16:49:19 -0600 |
| commit | 1ce509b6b6749667f5fb3313a93393390aef3231 (patch) | |
| tree | 96409e22d8dcf18df33f00a8b31dc0fec708efcd /docs/protocol.rst | |
| parent | 6cc42a22db501bc175c977c514951ae8e37236cf (diff) | |
| download | eventmq-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.rst | 101 |
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 | ||
| 6 | Goals | 6 | Goals |
| 7 | ===== | 7 | ===== |
| 8 | 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 | 8 | 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. |
| 9 | 9 | ||
| 10 | The goals are to: | 10 | The 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 | |||
| 60 | 4 _MSGID_ The message id of the message this ACK is acknowledging | 60 | 4 _MSGID_ The message id of the message this ACK is acknowledging |
| 61 | ====== ============== =========== | 61 | ====== ============== =========== |
| 62 | 62 | ||
| 63 | A **REPLY** frame consists of a 5-frame multipart message, formatted as follows. | ||
| 64 | |||
| 65 | ====== ============== =========== | ||
| 66 | FRAME Value Description | ||
| 67 | ====== ============== =========== | ||
| 68 | 0 _EMPTY_ leave empty | ||
| 69 | 1 eMQP/1.0 Protocol version | ||
| 70 | 2 REPLY command | ||
| 71 | 3 _MSGID_ A unique id for the msg | ||
| 72 | 4 _MSG_ The reply to respond with | ||
| 73 | ====== ============== =========== | ||
| 74 | |||
| 75 | A **HEARTBEAT** frame consists of a | ||
| 76 | |||
| 77 | ====== ============== =========== | ||
| 78 | FRAME Value Description | ||
| 79 | ====== ============== =========== | ||
| 80 | 0 _EMPTY_ leave empty | ||
| 81 | 1 eMQP/1.0 Protocol version | ||
| 82 | 2 HEARTBEAT command | ||
| 83 | 3 _MSGID_ A unique id for the msg | ||
| 84 | 4 _UNIX_TS_ A unix timestamp | ||
| 85 | ====== ============== =========== | ||
| 86 | |||
| 87 | A **DISCONNECT** frame consists of | ||
| 88 | |||
| 89 | ====== ============== =========== | ||
| 90 | FRAME Value Description | ||
| 91 | ====== ============== =========== | ||
| 92 | 0 _EMPTY_ leave empty | ||
| 93 | 1 eMQP/1.0 Protocol version | ||
| 94 | 2 DISCONNECT command | ||
| 95 | 3 _MSGID_ A unique id for the msg | ||
| 96 | ====== ============== =========== | ||
| 97 | |||
| 98 | A **KBAI** frame consists of | ||
| 99 | |||
| 100 | ====== ============== =========== | ||
| 101 | FRAME Value Description | ||
| 102 | ====== ============== =========== | ||
| 103 | 0 _EMPTY_ leave empty | ||
| 104 | 1 eMQP/1.0 Protocol version | ||
| 105 | 2 KBAI command | ||
| 106 | 3 _MSGID_ A unique id for the msg | ||
| 107 | ====== ============== =========== | ||
| 108 | |||
| 63 | eMQP / Client | 109 | eMQP / Client |
| 64 | ------------- | 110 | ------------- |
| 65 | A **REQUEST** command consists of a 7-frame multipart message, formatted as follows. | 111 | A **REQUEST** command consists of a 7-frame multipart message, formatted as follows. |
| @@ -159,44 +205,9 @@ FRAME Value Description | |||
| 159 | 3 _MSGID_ A unique id for the msg | 205 | 3 _MSGID_ A unique id for the msg |
| 160 | ====== ============== =========== | 206 | ====== ============== =========== |
| 161 | 207 | ||
| 162 | A **REPLY** frame consists of a 5-frame multipart message, formatted as follows. | ||
| 163 | |||
| 164 | ====== ============== =========== | ||
| 165 | FRAME Value Description | ||
| 166 | ====== ============== =========== | ||
| 167 | 0 _EMPTY_ leave empty | ||
| 168 | 1 eMQP/1.0 Protocol version | ||
| 169 | 2 REPLY command | ||
| 170 | 3 _MSGID_ A unique id for the msg | ||
| 171 | 4 _MSG_ The reply to respond with | ||
| 172 | ====== ============== =========== | ||
| 173 | |||
| 174 | A **HEARTBEAT** frame consists of a | ||
| 175 | |||
| 176 | ====== ============== =========== | ||
| 177 | FRAME Value Description | ||
| 178 | ====== ============== =========== | ||
| 179 | 0 _EMPTY_ leave empty | ||
| 180 | 1 eMQP/1.0 Protocol version | ||
| 181 | 2 HEARTBEAT command | ||
| 182 | 3 _MSGID_ A unique id for the msg | ||
| 183 | 4 _UNIX_TS_ A unix timestamp | ||
| 184 | ====== ============== =========== | ||
| 185 | |||
| 186 | A **DISCONNECT** frame consists of | ||
| 187 | |||
| 188 | ====== ============== =========== | ||
| 189 | FRAME Value Description | ||
| 190 | ====== ============== =========== | ||
| 191 | 0 _EMPTY_ leave empty | ||
| 192 | 1 eMQP/1.0 Protocol version | ||
| 193 | 2 DISCONNECT command | ||
| 194 | 3 _MSGID_ A unique id for the msg | ||
| 195 | ====== ============== =========== | ||
| 196 | |||
| 197 | Heartbeating | 208 | Heartbeating |
| 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 | ||
| 207 | Headers | 218 | Headers |
| 208 | --------------- | 219 | --------------- |
| 209 | Headers 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. | 220 | Headers 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 | ||
| 211 | Below is a table which defines and describes the headers. | 222 | Below is a table which defines and describes the headers. |
| 212 | 223 | ||
| 224 | |||
| 213 | ================= ======= ======= ======== ======= =========== | 225 | ================= ======= ======= ======== ======= =========== |
| 214 | Header REQUEST PUBLISH SCHEDULE Default Description | 226 | Header REQUEST PUBLISH SCHEDULE Default Description |
| 215 | ================= ======= ======= ======== ======= =========== | 227 | ================= ======= ======= ======== ======= =========== |
| @@ -218,3 +230,14 @@ retry-count:# X 0 Retry a failed job this many | |||
| 218 | guarantee X False Ensure the job completes by letting someone else worry about a success reply. | 230 | guarantee X False Ensure the job completes by letting someone else worry about a success reply. |
| 219 | nohaste 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. | 231 | nohaste 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 | |||
| 234 | DISCONNECT and KBAI | ||
| 235 | =================== | ||
| 236 | When 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 | |||
| 241 | When 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. | ||