Skip to content

Learn how to subscribe to Salesforce CDC events in real-time and look at the message payload

License

Notifications You must be signed in to change notification settings

mulesoft-developers/salesforce-change-data-capture

Repository files navigation


Subscribing to Change Data Capture Events with the Salesforce Connector

Learn how to subscribe to Salesforce CDC events in real-time and inspect the inbound message payload

Tutorial and Video

For a step by step tutorial navigate to the MuleSoft developer website here

For a video of the tutorial go here.

Overview

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.

Installation Instructions

Install instructions

  1. Download Anypoint Studio

  1. Signup for a free Salesforce Developer Edition Org

  2. Clone this repository.

  3. In Anypoint Studio, select File > Import > Anypoint Studio > Anypoint Studio project from File System and click Next.

  4. Select the cloned repository in the Project Root and make sure to uncheck the Copy project into workspace option.

  5. Click on Finish.

  6. 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).

  7. 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

Contributing

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.

About

Learn how to subscribe to Salesforce CDC events in real-time and look at the message payload

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages