INTEGRATION-ARCHITECTURE-DESIGNER practice question 21 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 questionsDomain Design an Integration Solution
When a platform event is published within a Salesforce transaction (e.g., from an Apex trigger or a Flow), the event message is not sent to the event bus immediately. Instead, it is queued. The actual publication occurs only after the associated database transaction has been successfully committed. This transactional behavior is a critical design feature that ensures data consistency. If the transaction were to fail and roll back for any reason, the queued event message would be discarded and never published, preventing external systems from acting on data that was never permanently saved in Salesforce.
A. The platform events are published immediately before the Apex transaction completes. This is incorrect. Publishing before a commit could lead to external systems receiving notifications about data changes that are ultimately rolled back, causing data inconsistency.
C. The platform events has a trigger in Apex. An Apex trigger on a platform event is for subscribing to (consuming) events, not publishing them. The question is about the act of publishing.
D. The platform events are being published from Apex. While publishing from Apex is a common method, it is not the only one (e.g., Flows, APIs). This option describes a potential implementation method, not the fundamental transactional process that occurs during publication.
1. Salesforce Platform Events Developer Guide, "Publish Platform Events" section: "To publish event messages, you call the EventBus.publish() method... The publishing of the event message happens after the transaction is successfully committed. If the transaction fails, the event message isn't published."
2. Apex Developer Guide, "EventBus Class" section: Under the publish method description, it states: "The publish method queues the event for publishing. The event is published asynchronously after the transaction is committed."
3. Salesforce Architects, "Architect's Guide to Event-Driven Architecture with Salesforce" Whitepaper, Page 10: "When publishing platform events from Apex, the publish operation is transactional with the Salesforce transaction. That is, the event is only published if the transaction completes successfully."
Keep practicing
Take the free INTEGRATION-ARCHITECTURE-DESIGNER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other INTEGRATION-ARCHITECTURE-DESIGNER practice questions
- Question 1Northern Trail Outfitters has a requirement to encrypt few of widely used standard fields…
- Question 2An Integration Developer is developing an HR synchronization app for a client. The app sy…
- Question 3Northern Trail Outfitters submits orders to the manufacturing system web-service. Recentl…
- Question 4Customer is evaluating Platform Events solution and would like help in comparing/contrast…
- Question 5Universal Containers (UC) is a large printing company that sells advertisement banners. T…
- Question 6A large consumer goods manufacturer operating in multiple countries is planning to implem…
