I am developing a simple component to call external service in AWS Which will create PDF file in the s3. When the PDF is created the service will change the object status. Is it possible to use empapi to subscribe to the event which wil fires when the status is set to complete? If so which types of event I need to use topic/cdc/...
You can use
- Platform Event
- Push Topics (not preferred)
- Change Data Capture
You can refer to Salesforce events.
Basically Push topics are very limited because you can create only 100 records. Implementation of platform events is a little more complex than implementation of change data capture as you need to create platform event object and then fire that event while data capture event has to be just enabled for the particular object in setup. Below are the other detailed points:
The generation of PushTopic notifications follows this sequence.
- Create a PushTopic based on a SOQL query. The PushTopic defines the channel.
- Clients subscribe to the channel.
- A record is created, updated, deleted, or undeleted (an event occurs). The changes to that record are evaluated.
- If the record changes match the criteria of the PushTopic query, a notification is generated by the server and received by the subscribed clients.
Change Data Capture:
Use change events to:
- Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations.
- Capture field changes for all records.
- Get broad access to all data regardless of sharing rules.
- Get information about the change in the event header, such as the origin of the change, which allows ignoring changes that your client generates.
- Perform data updates using transaction boundaries.
- Use a versioned event schema.
- Subscribe to mass changes in a scalable way.
- Get access to retained events for up to three days.