Capturing Salesforce object changes in real time with Talend ESB
This article shows how to capture and propagate real time changes happening in Salesforce using Talend ESB.
Salesforce provides on-demand customer relationship management (CRM) software services and many Talend users have chosen Salesforce as their cloud CRM provider.
Some users want to capture real time changes occurring in Salesforce on their CRM data in order to propagate or synchronize those changes on third-party applications. It is somewhat similar to Change Data Capture with Relational Databases, but for Salesforce.
Overview
In order to capture and propagate real time changes happening in Salesforce, you need the following technologies:
- Salesforce Notification and Outbound Messaging
- Talend ESB and Web Services technologies
- Apache ActiveMQ
Outbound Messaging is part of the workflow rule functionality in Salesforce. Workflow rules watch for specific kinds of field changes and trigger automatic Salesforce actions, such as sending an outbound message to external applications.
To understand this article, you need some knowledge of Salesforce and Outbound Messaging, Talend ESB and Mediation routes, Web Services technologies, and Apache ActiveMQ.
Environment
This article was written using the commercial version of Talend ESB 6.2 which provides more features than the open source version.
This article is also valid for previous commercial versions of Talend ESB.
Prerequisites
- You have a valid Salesforce account: a free Developer Edition account can be created for testing purposes on the Salesforce website at https://developer.salesforce.com/signup.
- You have installedTalend Studio 6.2 installed.
- You have a installed Apache ActiveMQ: ActiveMQ is shipped with the Talend ESB installation. Alternatively, it can be downloaded from the Apache ActiveMQ website.
For more information on the procedure to install and configure both Talend ESB and ActiveMQ, see Talend Help Center.
Architecture of the flow to capture changes
The diagram below shows the architecture for this example:
- Salesforce User updates a Salesforce object.
- Salesforce sends an outbound message to Talend ESB to notify object update.
- Talend ESB persists the notification message in an ActiveMQ queue.
- Talend ESB receives acknowledgement of successful persistence in ActiveMQ.
- Talend ESB answers with a successful acknowledgement back to Salesforce.
Configuring Salesforce to send changes notifications to Talend
This section explains how to setup Salesforce to send outbound notifications on objects changes.
It focuses on the standard Salesforce Account object, but the procedure remains the same for all other Salesforce standard or custom objects.
Procedure
Results
Salesforce is now setup and ready to send notifications to Talend ESB every time an account is created or updated in your Salesforce organization. The next step is to implement the Talend Web Service which will be listening for these notifications coming from Salesforce.
It is important to handle these upcoming notifications in a reliable manner. You must not lose any of these notifications once you receive and acknowledge them, even if a failure or crash occurs on Talend ESB, because Salesforce is not going to send again any acknowledged notification.
Downloading the Salesforce notification WSDL document
Procedure
Configuring Talend ESB to listen for and process Salesforce notifications using the Notification WSDL
Procedure
Results
The Route salesforce_account_synchro should now look like this: