This Level 3 documentation and implementation diagram shows an example of the publish / subscribe pattern that depicts an event being published when a record is modified via a user interaction, a flow, or a batch job. Subscribers receive their own unique copies of events and make the appropriate updates to their own records. In this pattern, the message channel is aware of all the subscribers and creates event copies for each one, enabling subscribers to replay events if needed.

Download Diagram
Open the template in Lucidchart (Lucidchart account required)

Pattern Overview

With the publish / subscribe (unique copy) pattern, publishers and subscribers exchange messages via one or more channels in an event bus. Subscribers listen to the appropriate channels and receive new messages as they arrive. Unique copies of each message are sent to each subscriber, which makes it possible to guarantee delivery and identify which subscribers received which messages. Systems can also use replay functionality to recover past events, which helps to ensure resilience against system failures.

This is a Level 3 Documentation and Implementation diagram according to the Salesforce diagram framework.

Learn more by reading the Architect's Guide to Event-Driven Architecture with Salesforce.