Platform Events & Change Data Capture (CDC) โ Interview Questions & Scenarios (2026)
Event replay channels, 72-hour retention, duplicate event deduplication, and CDC vs Platform Events.
โก Platform Events & Change Data Capture (CDC)
Event replay channels, 72-hour retention, duplicate event deduplication, and CDC vs Platform Events.
What are Platform Events? How do you subscribe in MuleSoft?
Platform Events: Custom events you define in Salesforce and publish explicitly. Business events:
Order Closed, Payment Processed.
CDC (Change Data Capture): Automatic events fired by Salesforce on any record change โ no
Apex/code needed. Includes changeType (CREATE/UPDATE/DELETE), changedFields.
Subscribe to Platform Event
REPLAYID MEANING
-1 New events only (default for initial deploy)
-2 All retained events (last 72 hours) โ use on app restart
N Replay from specific event ID forward
Project: Commercial Banking โ Real-Time Order Status Notification.
Problem: Traditional scheduled polling every 2 minutes was too slow for customer notifications and wasted 70,000 API calls daily.
What I Did: Subscribed to Salesforce `Order_Status_Event__e` Platform Events via MuleSoft Replay Channel Listener, routing events through Anypoint MQ for async processing.
Result: Achieved end-to-end event notification latency of under 400ms while eliminating 100% of polling API calls.
What is event retention? What if Mule app is down >72 hours?
Salesforce Platform Events and CDC are retained for 72 hours. If MuleSoft subscriber restarts with
replayId="-2" , it receives all events from the last 72 hours โ nothing is lost for normal downtime.
If downtime exceeds 72 hours: those events ARE permanently lost. Mitigation: also publish to
Anypoint MQ (default 4โ7 day retention, configurable up to 14 days; 10 MB max message payload) as durable backup fan-out for critical events. Or implement a Scheduler that
queries Salesforce directly for records modified during the downtime window using LastModifiedDate
> :lastRun watermark.
How do you handle duplicate Platform Events (at-least-once delivery)?
Salesforce uses at-least-once delivery โ duplicates are possible. Implement idempotency with
ObjectStore:
Idempotency Pattern
// 1. Extract Replay ID or business key from event
// 2. Check ObjectStore
os:contains(key=replayId, objectStore=idempotency-store)
// EXISTS โ skip and ACK
// NOT EXISTS โ process โ os:store(key, TTL=72h) โ ACK
Use acknowledgementMode="MANUAL" so ACK only happens after successful ObjectStore write +
processing.
Project: Healthcare โ Real-Time Order Status Notification.
Problem: Traditional scheduled polling every 2 minutes was too slow for customer notifications and wasted 70,000 API calls daily.
What I Did: Subscribed to Salesforce `Order_Status_Event__e` Platform Events via MuleSoft Replay Channel Listener, routing events through Anypoint MQ for async processing.
Result: Achieved end-to-end event notification latency of under 400ms while eliminating 100% of polling API calls.
Difference between Platform Events and CDC?
| ASPECT | PLATFORM EVENTS | CDC |
|---|---|---|
| Who publishes | You publish explicitly via Apex, Flow, or MuleSoft | Salesforce fires automatically on any record change |
| Payload | Custom fields you define | Includes changeType, changedFields, old+new values |
| Use case | Business process events (Order Closed, Payment Done) | Data synchronization โ DB replica, DW sync |
| Channel | /event/EventName__e | /data/ObjectChangeEvent |
Project: Logistics โ Real-Time Order Status Notification.
Problem: Traditional scheduled polling every 2 minutes was too slow for customer notifications and wasted 70,000 API calls daily.
What I Did: Subscribed to Salesforce `Order_Status_Event__e` Platform Events via MuleSoft Replay Channel Listener, routing events through Anypoint MQ for async processing.
Result: Achieved end-to-end event notification latency of under 400ms while eliminating 100% of polling API calls.