ARC-101 practice question 8 of 25
An Integration Architect has built a Salesforce application that integrates multiple systems and keeps them synchronized via Platform Events. What is taking place if events are only being published?
Full set: 106 questionsIn Salesforce, when Platform Events are published from within an Apex transaction using the EventBus.publish() method, the events are not sent immediately. Instead, they are queued. The actual publication to the event bus occurs only after the entire Apex transaction has been successfully committed to the database. This transactional behavior is a critical feature that ensures data consistency, as it prevents events from being published if the originating transaction fails and is rolled back. The events are discarded along with the other rolled-back changes.
1. Salesforce Platform Events Developer Guide, "Publish Events with Apex": "To publish an event message, you call the EventBus.publish() method... The event is published after the transaction is committed. If the transaction fails, the event isn't published."
2. Salesforce Apex Developer Guide, "EventBus Class": The documentation for the publish method states: "The publishing of events is transactional. The events are published only after the transaction completes successfully. If the transaction is rolled back, the events aren't published."
3. Salesforce Platform Events Basics Trailhead Module, "Publish and Subscribe to Platform Events": "When you publish a platform event with Apex, the EventBus.publish() method call is queued. The event is actually published when the transaction is successfully committed."
Keep practicing
Take the free ARC-101 practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ARC-101 practice questions
- Question 1Northern Trail Outfitters has had an increase in requests from other business units to in…
- Question 2Salesforce users need to read data from an external system via HTTPS request. Which two s…
- Question 3The director of customer service at Northern Trail Outfitters (NTO) wants to capture and …
- Question 4Northern Trail Outfitters (NTO) has recently changed their Corporate Security Guidelines.…
- Question 5An Integration Architect has designed a mobile application for Salesforce users to get da…
- Question 6A company needs to integrate a legacy on premise application that can only support SOAP A…
