Newer Version Available

This content describes an older version of this product. View Latest

Subscribe to Publish Status Events with a CometD Client—EMP Connector (Beta)

To subscribe to publish status events with EMP Connector or another CometD client, supply this channel: /event/PublishStatusEvent.

As a beta feature, Publish Status Events is a preview and isn’t part of the “Services” under your master subscription agreement with Salesforce. Use this feature at your sole discretion, and make your purchase decisions only on the basis of generally available products and features. Salesforce doesn’t guarantee general availability of this feature within any particular time frame or at all, and we can discontinue it at any time. This feature is for evaluation purposes only, not for production use. It’s offered as is and isn’t supported, and Salesforce has no liability for any harm or damage arising out of or in connection with it. All restrictions, Salesforce reservation of rights, obligations concerning the Services, and terms for related Non-Salesforce Applications and Content apply equally to your use of this feature. You can provide feedback and suggestions for Publish Status Events in the Trailblazer Community. For information on enabling this feature in your org, contact Salesforce.

Note

This example shows the payload received for a publish status of success and contains information for two events. Because the publish operations were successful, the replay ID for each event is available in the Replay field and the FailureReason and StatusCode fields are empty. The EventUuid field correlates the publish result of each event with the original publish call.

1{
2  "schema": "tklL37cct1eXnqi_yPIS7w",
3  "payload": {
4    "Status": "SUCCESS",
5    "AdditionalInfo": null,
6    "CreatedById": "005xx000001X83aAAC",
7    "CreatedDate": "2020-08-06T20:16:44.400Z",
8    "PublishStatusDetails": [
9      {
10        "Replay": 7,
11        "EventUuid": "6ba5db7e-c27b-4a67-a3c5-cf425ffcaf53",
12        "FailureReason": null,
13        "StatusCode": null
14      },
15      {
16        "Replay": 10,
17        "EventUuid": "5a520ebe-6ac5-49b3-a3e0-6f9f81361c79",
18        "FailureReason": null,
19        "StatusCode": null
20      }
21    ],
22    "Topic": "Order_Event__e"
23  }
24}

This example shows the payload for a publish status of failure and contains information for two events. Because the publish operations failed, the replay IDs are not available in the Replay fields. The FailureReason and StatusCode fields contain information about the error. The EventUuid field correlates the publish result of each event with the original publish call.

1{
2  "schema": "tklL37cct1eXnqi_yPIS7w",
3  "payload": {
4    "Status": "FAILURE",
5    "AdditionalInfo": null,
6    "CreatedById": "005xx000001X83aAAC",
7    "CreatedDate": "2020-08-06T20:20:23.573Z",
8    "PublishStatusDetails": [
9      {
10        "Replay": null,
11        "EventUuid": "e981b488-81f3-4fcc-bd6f-f7033c9d7ac3",
12        "FailureReason": 
13          "The platform event message could not be published. Try again later.",
14        "StatusCode": "PLATFORM_EVENT_PUBLISH_FAILED"
15      },
16      {
17        "Replay": null,
18        "EventUuid": "ed5773c8-6848-4eee-99cf-2d3703cc0da3",
19        "FailureReason": 
20          "The platform event message could not be published. Try again later.",
21        "StatusCode": "PLATFORM_EVENT_PUBLISH_FAILED"
22      }
23    ],
24    "Topic": "Order_Event__e"
25  }
26}