RECIPE 21 - Handle Salesforce Streaming Content with an API

A streaming API works differently from a normal HTTP API. In case of a streaming API, the data is more continuous and event-driven. The objective of this recipe is to create a flow which can consume streaming data from sources like Twitter, Facebook, and Salesforce. For this recipe the Salesforce Connector is used as a streaming inbound connector. The data from Salesforce would be stored in a database.

In Salesforce, a PushTopic should be created through which the streaming data can be consumed. Below are the steps to enable streaming in Salesforce (referred from Salesforce Developer’s Guide):

  • Create a PushTopic based on a Salesforce Object Query Language (SOQL) query. This defines the channel.
  • Clients subscribe to the channel.
  • A record is created, updated, deleted, or undeleted (an event occurs). The changes to that record are evaluated.
  • If the record changes match the criteria of the PushTopic query, a notification is generated by the server and received by the subscribed clients.

API Recipe Handle Salesforce Streaming Content with an API