Salesforce push topic
Overview
A Salesforce Push Topic is a supported Sync Source that you can use in your Cinchy data syncs. The below documentation will refer to the parameters necessary to set up your Push Topic as part of your sync configuration.
Scenarios
You can use a Push Topic already configured in Salesforce, or have Cinchy Event Listener create the Push Topic for you.
Scenario 1: Push Topic already exists in Salesforce.
Cinchy will compare the JSON with the properties on the push topic in Salesforce by name. If the attributes match, the listener will start listening on the push topic.
Scenario 2: Push Topic already exists in Salesforce and the configuration does not match.
Cinchy will compare the JSON with the properties on the push topic in Salesforce by name. If any of the attributes do not match, Cinchy will sync the push topic from Salesforce into Cinchy and disable the listener.
Scenario 3: Push Topic does not exist in Salesforce.
If the Push Topic name does not exist in Salesforce, Cinchy will attempt to create the Push Topic. If it is successful, it will sync in the Id from Salesforce and start listening on the push topic.
Configuring the Sync
All of the configuration parameters and variables for this real-time sync are the same as those outlined in the Salesforce Push Topic documentation. The only difference is that you must also set up your listener configuration as per the next section.
The Listener Configuration
In Cinchy v5.7+, configuring the listener can be done directly in the Connections UI, however for multiple listener requirements you must still add additional configurations in the Listener Config table.
To set up an Stream Source, you must set up a Listener Configuration. The below table describes the parameters and their relevant descriptions.
- Listener Config
- Topic
- Connection Attribute
\The following column parameters can be found in the Listener Config table:
Parameter | Description | Example |
---|---|---|
Name | Mandatory. Provide a name for your listener config. | Salesforce push topic real-time sync |
Event Connector Type | Mandatory. Select your Connector type from the drop-down menu. | Salesforce push topic |
Topic | Mandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring. | See the Topic tab. |
Connection Attributes | Mandatory. This field is expecting a JSON formatted value specific to the connector type you are configuring. | See the Connection Attributes tab. |
Status | Mandatory. Set to "Enabled" to activate the listener. Leave on "Disabled" until you are ready to start syncing. | Enabled /Disabled |
Running Status | Read-only. Shows the current state of the listener as Starting, Running, or Failed. This is automatically managed by the system. For more information, see the Listener status section. | Running |
Active | Managed by User/System. Indicates whether the listener is set to retry after failure ("Yes") or has stopped attempting to sync and requires user intervention ("No"). | Yes /No |
Data Sync Config | Mandatory. This drop-down will list all the data syncs on your platform. Select the one that you want to use for your real-time sync. | CDC Data Sync |
Subscription Expires On | Salesforce Stream Sources only. This field is a timestamp that's auto populated when it has successfully subscribed to a topic. | |
Message | Auto-populated. This field reports errors that occur during the sync. | |
Auto Offset Reset | Earliest, Latest, None. Determines where to start reading events if there is no last message ID or if it's invalid. Can be adjusted post-configuration. Learn more | Earliest ,Latest , None |
The below table can be used to help create your Topic JSON needed to set up a real-time sync.
Parameter | Description | Example |
---|---|---|
Id | ||
Name | Mandatory. Descriptive name of the PushTopic. Note that there is a 25 character limit on this field. | LeadsTopic |
Query | Mandatory. The SOQL query statement that determines which record changes trigger events to be sent to the channel.Note that there is a 1,300 character limit on this field. | SELECT Id, Name, Email FROM Lead |
ApiVersion | Mandatory. The API version to use for executing the query specified in Query. It must be an API version greater than 20.0. If your query applies to a custom object from a package, this value must match the package's ApiVersion. | 47.0 |
NotifyForOperationCreate | Set this to true if a create operation should generate a notification, otherwise, false. Defaults to true. | true |
NotifyForOperationUpdate | Set this to true if an update operation should generate a notification, otherwise, false. Defaults to true. | true |
NotifyForOperationUndelete | Set this to true if an undelete operation should generate a notification, otherwise, false. Defaults to true. | true |
NotifyForOperationDelete | Set this to true if a delete operation should generate a notification, otherwise, false. Defaults to true. | true |
NotifyForFields | Specifies which fields are evaluated to generate a notification. Possible values are:AllReferenced (default)SelectWhere | Referenced |
Example Topic JSON
{
"Id": "",
"Name": "LeadsTopic",
"Query": "SELECT Id, Name, Email FROM Lead",
"ApiVersion": 47.0,
"NotifyForOperationCreate": true,
"NotifyForOperationUpdate": true,
"NotifyForOperationUndelete": true,
"NotifyForOperationDelete": true,
"NotifyForFields": "Referenced"
}
The below table can be used to help create your Connection Attributes JSON needed to set up a real-time sync.
Parameter | Description | Example |
---|---|---|
ApiVersion | Mandatory. Your Salesforce API Version. Note that this needs to be an exact match; for instance "47.0" cannot be written as simply "47". | 47.0 |
GrantType | This value should be set to password . | password |
ClientId | The encrypted Salesforce Client ID. You can encrypt this value using the Cinchy CLI. | See example below |
ClientSecret | The encrypted Salesforce Client Secret. You can encrypt this value using the Cinchy CLI. | DyU1hqde3cWwkPOwK97T6rzwqv6t3bgQeCGq/fUx+tKI= |
Username | The encrypted Salesforce username. You can encrypt this value using the Cinchy CLI. | dXNlcm5hbWVAZW1haWwuY29t |
Password | The encrypted Salesforce password You can encrypt this value using the Cinchy CLI. | cGFzc3dvcmRwYXNzd29yZA== |
InstanceAuthUrl | The authorization URL for Salesforce instance. | https://login.salesforce.com/services/oauth2/token |