Learn how to subscribe to Salesforce CDC events in real-time and inspect the inbound message payload
For a step by step tutorial navigate to the MuleSoft developer website here
For a video of the tutorial go here.
In this tutorial, we’ll walk you through how you can subscribe to change data capture (CDC) events in Salesforce to exchange real-time data with external apps. You’ll learn how to :
- Enable change data capture events in Salesforce
- Use the Salesforce connector to subscribe to a Contact change event
- View the structure of a change data capture event in Anypoint Studio
This sample application is designed to run on MuleSoft's Anypoint Platform.
Install instructions
- Download Anypoint Studio
-
Signup for a free Salesforce Developer Edition Org
-
Clone this repository.
-
In Anypoint Studio, select
File
>Import
>Anypoint Studio
>Anypoint Studio project from File System
and click Next. -
Select the cloned repository in the Project Root and make sure to uncheck the
Copy project into workspace
option. -
Click on Finish.
-
Update your Salesforce Developer Edition Org credentials in the config.yaml file In Anypoint Studio's package explorer open src/main/resources open local.secure.yaml and update the username, password and token. Note that password and token should be encrypted (see video and tutorial above for details).
-
Add Runtime Configurations for env and secret.key variables. Set env to local and set secret.key to be the value used to encrypt your secure property parameters.
This tutorial uses standard objects. To use change data capture events for custom objects follow the same steps except for the streaming channel value. For a custom object remove the c suffix from the object name. So for a Memo__c custom object the streaming channel is /data/Memo__ChangeEvent
Contributions are what make the MuleSoft community such an amazing place. Any contributions you make are greatly appreciated.
See contributing.md for the MuleSoft Developer principles.