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 an SOQL payload with muttiple record IDs. When set to false, callback platform events are not processed. |
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. |
The following example shows how to define a 5-queue configuration with the following four named queues, plus the default system queue (_fallback).
◦ wo_and_event
◦ event_only
◦ group_member_and_product_and_contact
◦ 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 platform events for Work Order-related Salesforce Event and ServiceMax Event records |
Single Update Event and Remove Event platform events for Work Order-related Salesforce Event and ServiceMax Event records created in the past 24 hours |
Single Update Event and Remove Event platform events for Work Order-related Salesforce Event and ServiceMax Event records created more than 24 hours in the past | event_only |
Bulk Create Job, Update Job, and Remove Job platform events for Work Order records | wo_callback |
Single Create, Update, and Delete platform events for Technician, Installed Product, and Contacts records. | group_member_and_product_and_contact |
Remaining platform events. | _fallback |
{
"_pe_queues": [
{
"id": "wo_and_event",
"objects": [
"SVMXC__Service_Order__c"
],
"operations": [
"svmx_check_wo_event_pe_for_transaction_queue"
],
"support_callback": false,
"type": "transaction"
},
{
"id": "event_only",
"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"
},
{
"id": "group_member_and_product_and_contact",
"objects": [
"SVMXC__Service_Group_Members__c",
"SVMXC__Installed_Product__c",
"Contact"
],
"support_callback": false,
"type": "master"
}
]
}
Results look similar to the following example:
{
"wo_and_event": {
"processed_size": 69, //Total number of Processed Work order , SFE, SME platform events .
"queue_size": 0 //Total number of platform events(WO,SF,SME) in Queue waiting to be processed.
},
"wo_callback": {
"processed_size": 101, //Total number of Processed Work order platform events which are in Bulk (SOQL payload with multiple record IDs)
"queue_size": 0 //Total number of platform events in Queue waiting to be processed.
},
"_fallback": {
"processed_size": 54, //Total number of platform events not processed in the "wo_and_event" and "wo_callback" queues
"queue_size": 0 //Total number of platform events in Queue waiting to be processed.
}
}
4. In the top left corner, cick
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
"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: