Salesforce Decode
Salesforcedecode
Back to questions
IntegrationAdvancedplatform-eventsreliabilityoutbox

Handle Platform Event publish failure after database commit edge cases

Real World Scenario

Apex after insert publishes Platform Event; publish throws exception but Account already committed leaving subscribers never notified.

Expected Answer

• Transactional outbox pattern defer publish to async job • CDC on Account alternative if subscribers support • Try-catch publish log failure Integration_Log__c manual replay • Never rely solely on inline publish for critical downstream • Monitor publish failure rate EventBusPublishFailure • Queueable publish retries with exponential backoff • Business accept eventual consistency delay async publish

Follow-Up Questions & Answers

Click to expand — each follow-up includes a direct, interview-ready answer

Main difference: use case and scale. Transactional outbox pattern defer publish to async job. CDC on Account alternative if subscribers support. Pick based on your integration pattern and team capability. Inline Platform Event publish can fail post-commit—outbox or CDC for guaranteed notification path. Optimize for scale and operational observability.

Architect Perspective

Inline Platform Event publish can fail post-commit—outbox or CDC for guaranteed notification path.