Document Firehose protocol in PROTOCOL.md
bradgessler opened this issue · 0 comments
bradgessler commented
Document Firehose protocol for publishers and subscribers over HTTP Long Polling and WebSockets in PROTOCOL.md. Ideally the message formats should:
- Be kept as consistent as possible between publishing and consuming
- Remain as consistent as possible with its representation on the server https://github.com/firehoseio/firehose/blob/master/lib/firehose/server/message_buffer.rb#L10 and the wire format
- Remain consistent over its transport (e.g. web sockets is a
message
per frame, long polling is 1message
payload per HTTP request, batch subscriptions over HTTP long polling is a JSON array ofmessage
s.
I propose the following format for publishing:
// Message from service published to Firehose
{
"message": "Bee boop",
"channel": "/greetings/from/mars",
"ttl": 60
}
And the following for a client consuming a sequence of messages:
// Message from Firehose to consuming client
{
"message": "Bee boop",
"channel": "/greetings/from/mars",
"sequence": 101
}