Difference between revisions of "Zaqar/specs/Protocols/Wire Transport"
< Zaqar
Line 19: | Line 19: | ||
== Headers == | == Headers == | ||
+ | |||
+ | Even though Marconi's endpoints try to be as much similar as possible, there are some slightly difference between them. Note that ZMQ transport doesn't implement some of the HTTP headers since they're meaningless for it, like: | ||
+ | |||
+ | * Host | ||
+ | * Content-Length | ||
+ | * Accept-Encoding | ||
{| border="1" cellpadding="2" cellspacing="0" | {| border="1" cellpadding="2" cellspacing="0" |
Revision as of 09:04, 20 February 2013
Marconi ZMQ API: v1 Blueprint
Since zmq is all about messages and there's no *defined* high level protocol, Marconi defined its own which tries to be as much compliant as possible with HTTP structure.
Serialization
Marconi's ZMQ transport uses either messagepack or json as serialization format. It's recommended to use messagepack since it is faster and smaller than normal json.
Structure
{ header: { }, body: { } }
Headers
Even though Marconi's endpoints try to be as much similar as possible, there are some slightly difference between them. Note that ZMQ transport doesn't implement some of the HTTP headers since they're meaningless for it, like:
- Host
- Content-Length
- Accept-Encoding
Header | Description |
User-Agent | The name and version of the Marconi client, as well as a UUID for that client. Marconi uses the UUID to distinguish publishers from subscribers, i.e., to avoid echoing an agent's own messages back to it. |
Date | The current date and time, using the standard RFC 1123 HTTP date format |
Accept | Media type desired; Either `application/json` or `application/messagepack`; If none was specified, the later will be used. |
X-Auth-Token | Keystone auth token |
Example
{ "header": { "User-Agent": "python/2.7 killer-rabbit/1.2 uuid/30387f00-39a0-11e2-be4d-a8d15f34bae2", "Date": "Wed, 2 8 Nov 2012 21:14:19 GMT", "Accept": "application/messagepack", "X-Auth-Token": "7d2f63fd-4dcc-4752-8e9b-1d08f989cc00" }, "body": { ... } }