CloudServices/FirefoxMobileServices/ChannelService: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 94: Line 94:
=== Server-side Services ===
=== Server-side Services ===


Cloud Services can utilize an API to communicate with clients, based on message-passing from inbound/outbound queues.
Cloud Services can utilize an API to communicate with clients, based on message-passing from the outbound router and inbound relay.  
 
The inbound message queue for a Cloud Service contains the body of the message and metadata:
The inbound message queue for a Cloud Service contains the body of the message and metadata:


Line 106: Line 107:
The payload is an opaque blob that should be significant to the Cloud Service utilizing the channel.
The payload is an opaque blob that should be significant to the Cloud Service utilizing the channel.


XXX: Determine a standard encoding for the Payload
The outbound router for a Cloud Service contains the body of the message and metadata on what device the message
is intended for. If its not possible to deliver the message immediately (client disconnect, etc.) then the message
will be rejected.


The outbound message queue for a Cloud Service contains the body of the message and metadata on what device the message
Outbound message:
is intended for. It also contains retry policy information, and whether the message should be NACK'd in the event that
it was not possible to deliver the message.


<pre>
<pre>
Line 116: Line 117:
   MessageID: ce3488ea-cf7c-41c3-8110-9907b1fe80e8
   MessageID: ce3488ea-cf7c-41c3-8110-9907b1fe80e8
   DeviceID: AABCDC-550e8400-e29b-41d4-a716-446655440000
   DeviceID: AABCDC-550e8400-e29b-41d4-a716-446655440000
  Retry: 1m,5m,1h
  Nack: True
Payload: ................
Payload: ................
</pre>
</pre>


This indicates that the message should attempt 3 deliveries of the message, 1 minute later, than 5 minutes, than 1 hour after that. The inability to deliver the message in this case triggers a Nack which is delivered over the inbound queue
Outbound router response message:
to the Cloud Service application.
 
<pre>
Unavailable: ce3488ea-cf7c-41c3-8110-9907b1fe80e8
</pre>
 
This indicates that the message of the given MessageID could not be delivered at this time. In the event the DeviceID is not valid than it will be 'UnknownDeviceID' with the device ID as the message. Every message will generate a response indicating if it was successfully delivered or not. More messages may be transmitted at once and will be processed at once, in such a case responses may occur out of order.


In addition to basic bidirectional messaging, ChannelService broadcasts:
In addition to basic bidirectional messaging, ChannelService broadcasts:
* DeviceID changes
* DeviceID changes
* Nack's


If a device changes its DeviceID will change and the Cloud Service should account for this change.
If a device changes its DeviceID will change and the Cloud Service should account for this change.
Line 140: Line 143:


It is not expected that device ID's will change frequently, as a change indicates a client has changed geographic regions (North America -> South America, Europe -> North America, etc). Device ID's may change more frequently in the future if the geographic region is further confined (East Europe <-> West Europe).
It is not expected that device ID's will change frequently, as a change indicates a client has changed geographic regions (North America -> South America, Europe -> North America, etc). Device ID's may change more frequently in the future if the geographic region is further confined (East Europe <-> West Europe).
Nack Message:
<pre>
Type: Nack
Metadata:
  MessageID: ce3488ea-cf7c-41c3-8110-9907b1fe80e8
  DeviceID: AABCDC-550e8400-e29b-41d4-a716-446655440000
</pre>
It's safe to assume if a try at least 5m later failed, the client is offline.


==Platform Requirements==
==Platform Requirements==
Confirmed users
192

edits