2022
Streaming is a method used to transfer data over a network as a continuous flow. One of its main benefits is that it allows the data recipients to use it in an almost immediate manner, without having to wait until the complete data set has arrived at their computers.
Salesforce has a set of data APIs that can be used to manipulate the app’s data. Among them, the Streaming API is used to set notifications triggered by data changes. The notifications are sent from a server to a client.
...
Additionally, the API’s use of long polling or Comet Programming technique, reduces the number of requests that return no-data.
This Saleforce API has many important characteristics that define its behavior. Among them:
It is within the context of the Salesforce Streaming API that DBSync developed a connector that can be used specifically for real time integration. The connector is known as Salesforce Streaming Connector.
...
As the steps are similar to any DBSync process creation, we will concentrate on the steps with specific differences, namely steps 2, 4 and 5.
In order to create a Salesforce Streaming connector, simply press the button Create New Connector, and select the type Salesforce Streaming Connector.
Figure 1
As we mentioned earlier, we want to create a process that runs as continuously as possible. However, DBSync cannot detect if the process has stopped for any reason, and thus, it cannot restart it automatically.
In order to solve this problem, we need to set up the schedule at every one minute apart. The cron expression for this is “0/1 0/1 1/1 ?*”. Alternatively, we can simply select minutes and specify “1”.
Figure 2
As in our example we are transferring data from Salesforce to MySQL, we need to create a trigger that contains a query. This query must include the id of the Salesforce table, in our case Accounts, and the query must not include joins or aggregate functions. Besides, the WHERE clause must not include lookup fields.
Figure 3
When we create a new rule, we must make sure to map the Id from Salesforce to the MySQL table’s id.
Figure 4
The advantages of the Salesforce Streaming Connector can be easily seen by changing the value of, for example, the website of an account: the change is almost immediately reflected in our MySQL database.
Figure 5
Figure 6
DBSync’s Salesforce Streaming Connector allows us to link Salesforce to another application in practically real time.
...