Newer Version Available
Notification Message Order
Changes to data in your organization happen in a sequential manner. However, the order in which you receive event notification messages in Streaming API isn’t guaranteed. On the client side, you can use createdDate to order the notification messages returned in a channel. The value of createdDate is a UTC date/time value that indicates when the event occurred.
This code shows multiple messages, one generated by the creation of a record and one generated by the update of a record.
1{
2 "channel": "/topic/InvoiceStatementUpdates",
3 "clientId": "1g177wgjj14omtdo3rcl0hjhm4w",
4 "data": {
5 "event": {
6 "type": "updated",
7 "createdDate": "2013-05-10T18:16:19.000+0000"
8 },
9 "sobject": {
10 "Name": "INV-0002",
11 "test_ds__Status__c": "Negotiating",
12 "test_ds__Description__c": "Update to invoice statement #2",
13 "Id": "a00D0000008pvxcIAA"
14 }
15 }
16}
17
18{
19 "channel": "/topic/InvoiceStatementUpdates",
20 "clientId": "1g177wgjj14omtdo3rcl0hjhm4w",
21 "data": {
22 "event": {
23 "type": "created",
24 "createdDate": "2013-05-10T18:15:11.000+0000"
25 },
26 "sobject": {
27 "Name": "INV-0003",
28 "test_ds__Status__c": "Open",
29 "test_ds__Description__c": "New invoice statement #1",
30 "Id": "a00D0000008pvzdIAA"
31 }
32 }
33}