Configuring the EMP Platform Event Queue (Version 1)
When you configure the EMP platform event queue, you can choose to use legacy version 1 settings, or the newer version 2 settings, which support more flexible queues. The steps in this procedure cover how to use version 1 settings. For more information, see
Configuring the EMP Platform Event Queue (Version 2).
To configure the EMP platform event queue:
1. In
Max Designer, on the
Administration (
) launchpad menu, click
Settings, and then in the list view, in the top left corner, click
Create (
).
2. On the record page, complete the fields as follows.
Field | Value |
---|
Name | The name you want to use for the custom setting, for example, SFDC Real-Time Sync Customize Transform Rules. |
Applicable Application | Service Board |
Identifier | sfdc_realtime_sync_customize_transform_rules |
Datatype | Code |
3. On the record page, in the Default Value field, enter valid JSON.
The following example shows how to define a 3-queue configuration with the following two named queues plus the system default queue (_fallback).
◦ wo_and_event
◦ wo_callback
Platform events are sent to named queues as follows.
Platform Event Type | Destination Queue |
---|
Single Create Job, Update Job, and Remove Job platform events for Work Order records | wo_and_event |
Single Create Event, Update Event, and Remove Event platform events for Work Order-related Salesforce Event and ServiceMax Event records |
Bulk Create Job, Update Job, and Remove Job platform events for Work Order records | wo_callback |
Remaining platform events | _fallback |
{
"_pe_queues": [
{
"id": "wo_and_event",
"objects": [
"SVMXC__Service_Order__c"
],
"event_types": [
"create_event"
],
"operations": [
"svmx_check_pe_for_transaction_queue"
],
"support_callback": false,
"type": "transaction"
},
{
"id": "wo_callback",
"objects": [
"SVMXC__Service_Order__c"
],
"support_callback": true,
"type": "transaction"
}
]
}
| Any platform events that are not included in named queues are processed in the _fallback queue, which cannot be configured. |
Parameter | Description |
---|
id | Unique queue ID. No two queues can have the same value. |
object | Salesforce objects to be processed in the queue based on the platform event payload. |
event_types | Lists eventName values from platform event payloads that the queue processes, such as create, create_event, and update_job. | Not used in the default pe_queue configuration that ships with Service Board. |
|
operation | Optional operation to determine whether the queue processes platform events based on their payloads. If the operation returns true, platform events are processed in the queue. |
support_callback | When set to true, the queue processes callback platform events, such as platform events that contain SOQL payloads with multiple record IDs. When set to false, callback platform events are not processed. |
same_transaction | Whether records included in callback platform events, such as platform events that contain SOQL payloads with multiple record IDs, are processed in the same transaction. When set to false, callback platform events are processed in separate transactions. | Callback platform events that contain more than 200 records are split into groups of 200 records each, and the records in each group are processed together in the same transaction |
|
type | Whether platform events processed in the queue are considered transaction or master data for the following purposes: • Monitoring: Grouping queue information and sending statistics to New Relic. Queue information includes queued but not processed platform events, plus processed platform events. • Platform event lifespan: Determining whether platform events in the queue have expired based on configured Transaction Data Platform Event Lifespan and Master Data Platform Event Lifespan values in the active system setting. • Platform events processed in the _fallback queue are considered master data. Acceptable values are transaction and master. |
4. In the top left corner, click
Save and Close (
), and then on the
Development Actions (
) launchpad menu, click
Synchronize. 5. Restart the EMP service, and then monitor platform event processing for the newly configured queues.
Multi-Queue Platform Event Sync Queue Definition Examples
To configure platform event sync for all bulk-imported Work Order records in a separate queue:
{
"_pe_queues": [
{
"id":"wo_callback",
"objects": [
"SVMXC__Service_Order__c" //Work order object Name
],
"support_callback":true, //true if bulk imports should be included in this queue
"same_transaction":true, // true if process records included in callback platform event in the same transaction
"type":"transaction"
}
]
}
| For this example, all platform events not processed by the wo_callback queue are processed by the _fallback queue. |
To configure single-record platform event sync for all single-record platform events for all Installed Products in a separate queue:
{
"_pe_queues": [
{
"id": "wo_callback",
"objects": [
"SVMXC__Service_Order__c" //Work order object Name
],
"support_callback": true, //true if bulk imports should be included in this queue
"type": "transaction"
},
{
"id": "ip_single",
"objects": [
"SVMXC__Installed_Product__c". //Installed product Object Name
],
"support_callback": false, // false if the bulk imports to be not included in this queue.
"type": "master"
}
]
}
| For this example, all platform events not processed by the wo_callback and ip_single queues are processed by the _fallback queue. |
For more information: