Recipe 19 – Handling Salesforce Streaming content with APIs

A streaming API works differently from a normal HTTP API. In the case of streaming APIs, the data is more continuous and event-driven.

The objective of this Mule 4  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

The steps to enable streaming in Salesforce are:

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