Remain consistent over its transport (e.g. web sockets is a message per frame, long polling is 1 message payload per HTTP request, batch subscriptions over HTTP long polling is a JSON array of messages.
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
}
Document Firehose protocol for publishers and subscribers over HTTP Long Polling and WebSockets in PROTOCOL.md. Ideally the message formats should:
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:
And the following for a client consuming a sequence of messages: