Push Topic

For reference: https://developer.salesforce.com/docs/atlas.en-us.api_streaming.meta/api_streaming/pushtopic.htm

Topic JSON

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.

Sample 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"
}

See the Salesforce documentation for the description of each parameter.

The id column from Salesforce is mandatory for the query for Cinchy to sync the data.

Data Sync Configuration

Use SalesforcePushTopicDataSource as the source for a push topic.

The Id column is mandatory in the source.

Sample Data Sync Config

<?xml version="1.0" encoding="utf-16" ?>
<BatchDataSyncConfig name="Real Time Sync - LeadsTopic" version="1.0.0" xmlns="http://www.cinchy.co">
  <SalesforcePushTopicDataSource type="Event">
    <Schema>
      <Column ordinal="1" name="Id" dataType="Text" maxLength="100" />
      <Column ordinal="2" name="Name" dataType="Text" maxLength="100" />
      <Column ordinal="3" name="Email" dataType="Text" maxLength="100" />
    </Schema>
  </SalesforcePushTopicDataSource>
  <CinchyTableTarget model="" domain="Sales" table="Contacts">
    <ColumnMappings>
      <ColumnMapping sourceColumn="Id" targetColumn="Id" />
      <ColumnMapping sourceColumn="Name" targetColumn="Name" />
      <ColumnMapping sourceColumn="Email" targetColumn="Email" />
    </ColumnMappings>
    <SyncKey>
      <SyncKeyColumnReference name="Id" />
    </SyncKey>
    <NewRecordBehaviour type="INSERT" />
    <ChangedRecordBehaviour type="UPDATE" />
    <DroppedRecordBehaviour type="DELETE" />
  </CinchyTableTarget>
</BatchDataSyncConfig>

Last updated