Force.com Streaming API Overview

Force.com Streaming API uses publish/subscribe model for data transfer, where salesforce admin creates one or more topics, each of which is associated with a SOQL query. Applications may subscribe to one or more topics, using the Bayeux protocol. CometD implements the Bayeux protocol. Client applications must provide a session ID (sid) in all interactions.

pubsub

As relevant data is updated, the platform re-evaluates the query and, when a change occurs that alters the results of the query, the platform publishes a notification to subscribed applications.

The Bayeux protocol and CometD both use long polling.

Bayeux is a protocol for transporting asynchronous messages, primarily over HTTP.
CometD is a scalable HTTP-based event routing bus that uses an AJAX push technology pattern known as Comet. It implements the Bayeux protocol.

Streaming API vs. REST API

They both were designed for different use cases. The Streaming API is used to run uninterrupted, capturing everything from a continuous stream of data in real time. REST API is used to take a number of requests to perform a number of tasks, like getting weather report data, costing streams, and taking smaller samples of streams.

Gopal Das
Follow me

Leave a Reply

Your email address will not be published. Required fields are marked *