SlideShare a Scribd company logo
Create Lively Lightning
Components with
Streaming API
Anshul Verma
Cynoteck Technology Solutions LLC
Email: anshul.verma@Cynoteck.com
Twitter: @toanshulverma
Forcelandia 2018 - Create lively lightning components with streaming api
Agenda
• Need
• Traditional Model (Pull)
• Push notifications (browser)
• Example Use cases
• Live Demo
• Salesforce Streaming API
• What’s under the hood
• Code Walkthrough
• Q&A
Need
• Stale/ Old information
• True Collaboration with real time updates
• Decisions with most up to date information
• Faster response
• Adherence to Governor limits
Traditional Model (Pull)
Server
(Salesforce)
Client
(Browser)
2 3
Opens
connection
Connection
established
4 5
2
3
Client sends
request
4
Server sends
response
5
Connection
closed
6
Execution block -
every time
update is
required
1 6
User wants to view
updated
information
1
Push Notifications (browser)
Server
(Salesforce)
Client
(Browser)
1 2
Subscribe to a
Topic
Subscription
Confirmation
5
6
3
4
New information
arrives on server
Message pushed to
client
6
5
Execution block -
every time
update is
required
3 4
Initiate Handshake
Handshake
successful
1
2
Publisher/ Subsriber Model (Pub-Sub)
Publisher
(Salesforce)
Account updates New Payments New Credits
Subscriber 1 Subscriber 2 Subscriber 3 Subscriber N
……
Example Use Cases
Real time dashboards Real time notifications
Live Demo
Streaming API Basics
Push Topic
- Query - SOQL query qualifying a message
- NotifyForFields - Specify Fields which qualify to generate a push message
- Valid Values: All, Referenced (default), Select, Where
- NotifyForOperations – specify which operations qualify to generate a push message
- Valid Values: All (default), Create, Extended, Update
What is a Push Topic
Salesforce Streaming API Library – under the hood
- Javascript based API to internally handle complexity of connecting to Salesforce’s streaming API
and provides a developer friendly way
- Protocol – Bayeux
- Defines how asynchronous messages should be transported
- Messaging API - CometD
- Implements Bayeux protocol to create subscription endpoints and handle message distribution
- Streaming technique - Long Polling
- Client sends a request to server
- Server holds back response, untill a new message arrives
Long Polling (under the hood)
Server
(Salesforce)
Client
(Browser)
Salesforce Streaming API Library
Long polling mechanism to open connection to
server and allow server to wait and respond
Handshake Subscribe
New Message
Push
Notification
Code Walkthrough
Sample Notifications App
Step 1 : Create Push Topic
Push Topic
- Query - SOQL query qualifying a message
- NotifyForFields - Select
- NotifyForOperations – All
Step 2 : Initialize (handshake)
Server
(Salesforce)
Client
(Browser)
1 2
Step 3 : Subscribe
Server
(Salesforce)
Client
(Browser)
3 4
Step 4 : Handle Incoming Message
Server
(Salesforce)
Client
(Browser)
6
• Trailhead - https://trailhead.salesforce.com/en/modules/api_basics/units/api_basics_streaming
• Github (Demo source) –
• DeveloperForce - https://developer.salesforce.com/page/Streaming_API
• Streaming API Developer guide - https://developer.salesforce.com/docs/atlas.en-
us.api_streaming.meta/api_streaming/intro_stream.htm
Demo Source code
https://github.com/toanshulverma/Demo-RealTimeAlerts
Resources
Thank you

More Related Content

PPTX
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
PPTX
Web Real-time Communications
PPT
Netsuite open air connector
PDF
Grids by RavenApps for Salesforce
PPTX
API Proxy Auto Discovery
PPTX
Baltimore sep2019 mule_softsfdc
PPTX
Mule esb whole_web_services
PPTX
How to Wield Kentico 9 in the Real World
Mulesoft Salesforce Connector - OAuth 2.0 JWT Bearer
Web Real-time Communications
Netsuite open air connector
Grids by RavenApps for Salesforce
API Proxy Auto Discovery
Baltimore sep2019 mule_softsfdc
Mule esb whole_web_services
How to Wield Kentico 9 in the Real World

What's hot (20)

PPTX
Mule Anypoint API Gateway
PPTX
Apply Rate Limiting Policy
PPTX
Kentico 8 EMS API Deep Dive
PDF
MuleSoft certified platform architect-level 1 Real Exam Questions
PPTX
ESB Online Training Part 2
PPTX
Mule soa
PPTX
Dog Food Con 2015 Integrate & Automate CMS Deployments
PPTX
Anypoint platform for api
PPTX
SOAP To REST API Proxy
PPTX
Rate Limiting - SLA Based Policy
PPT
Best practices for multi saa s integrations
PPT
Mule api
PPTX
Mule esb stripe
PPT
Raml api designer
PPTX
Magento Developer Talk. Microservice Architecture and Actor Model
PPT
Dyna trace
PPTX
Custom connector development using mule DevKit
PPT
Mule real-world-old
PPTX
Real Time Web with SignalR
PPTX
Connecting to salesforce and using database in mule
Mule Anypoint API Gateway
Apply Rate Limiting Policy
Kentico 8 EMS API Deep Dive
MuleSoft certified platform architect-level 1 Real Exam Questions
ESB Online Training Part 2
Mule soa
Dog Food Con 2015 Integrate & Automate CMS Deployments
Anypoint platform for api
SOAP To REST API Proxy
Rate Limiting - SLA Based Policy
Best practices for multi saa s integrations
Mule api
Mule esb stripe
Raml api designer
Magento Developer Talk. Microservice Architecture and Actor Model
Dyna trace
Custom connector development using mule DevKit
Mule real-world-old
Real Time Web with SignalR
Connecting to salesforce and using database in mule
Ad

Similar to Forcelandia 2018 - Create lively lightning components with streaming api (20)

PDF
Durable Streaming and Enterprise Messaging
PDF
Real-Time Data Feeds Using the Streaming API
PPTX
Streaming API Push Topic.pptx
PPTX
Salesforce Streaming event - PushTopic and Generic Events
PDF
Streaming API with Java
PPTX
Understanding Salesforce Streaming API
PPTX
Salesforce Streaming Api
PPTX
No Refresh Needed
PDF
Streaming api with generic and durable streaming
PPTX
DF12 - Process Orchestration using Streaming API and Heroku
PDF
From Data Push to WebSockets
PDF
Realtime Content Delivery: Powering dynamic instant experiences
PDF
Damien Tanner, Pusher
PPTX
MuleSoft Meetup São Paulo #4 - November
PDF
2018 12-10 apidays.io eric horesnyi streamdata.io event-driven ap is
PDF
From Push Technology to Real-Time Messaging and WebSockets
PDF
ISV Monthly Tech Enablement (August 2017)
PPTX
February 2020 Salesforce API Review
PPTX
Learn MOAR Winter '20 Developer Community
PPTX
The Integrations Behind Connecting With Salesforce
Durable Streaming and Enterprise Messaging
Real-Time Data Feeds Using the Streaming API
Streaming API Push Topic.pptx
Salesforce Streaming event - PushTopic and Generic Events
Streaming API with Java
Understanding Salesforce Streaming API
Salesforce Streaming Api
No Refresh Needed
Streaming api with generic and durable streaming
DF12 - Process Orchestration using Streaming API and Heroku
From Data Push to WebSockets
Realtime Content Delivery: Powering dynamic instant experiences
Damien Tanner, Pusher
MuleSoft Meetup São Paulo #4 - November
2018 12-10 apidays.io eric horesnyi streamdata.io event-driven ap is
From Push Technology to Real-Time Messaging and WebSockets
ISV Monthly Tech Enablement (August 2017)
February 2020 Salesforce API Review
Learn MOAR Winter '20 Developer Community
The Integrations Behind Connecting With Salesforce
Ad

Recently uploaded (20)

PDF
Approach and Philosophy of On baking technology
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Machine learning based COVID-19 study performance prediction
PDF
A comparative analysis of optical character recognition models for extracting...
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PPTX
Cloud computing and distributed systems.
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Approach and Philosophy of On baking technology
Review of recent advances in non-invasive hemoglobin estimation
sap open course for s4hana steps from ECC to s4
Machine learning based COVID-19 study performance prediction
A comparative analysis of optical character recognition models for extracting...
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Cloud computing and distributed systems.
Advanced methodologies resolving dimensionality complications for autism neur...
Reach Out and Touch Someone: Haptics and Empathic Computing
20250228 LYD VKU AI Blended-Learning.pptx
NewMind AI Weekly Chronicles - August'25-Week II
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
MIND Revenue Release Quarter 2 2025 Press Release
Assigned Numbers - 2025 - Bluetooth® Document
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Digital-Transformation-Roadmap-for-Companies.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Forcelandia 2018 - Create lively lightning components with streaming api

  • 1. Create Lively Lightning Components with Streaming API Anshul Verma Cynoteck Technology Solutions LLC Email: anshul.verma@Cynoteck.com Twitter: @toanshulverma
  • 3. Agenda • Need • Traditional Model (Pull) • Push notifications (browser) • Example Use cases • Live Demo • Salesforce Streaming API • What’s under the hood • Code Walkthrough • Q&A
  • 4. Need • Stale/ Old information • True Collaboration with real time updates • Decisions with most up to date information • Faster response • Adherence to Governor limits
  • 5. Traditional Model (Pull) Server (Salesforce) Client (Browser) 2 3 Opens connection Connection established 4 5 2 3 Client sends request 4 Server sends response 5 Connection closed 6 Execution block - every time update is required 1 6 User wants to view updated information 1
  • 6. Push Notifications (browser) Server (Salesforce) Client (Browser) 1 2 Subscribe to a Topic Subscription Confirmation 5 6 3 4 New information arrives on server Message pushed to client 6 5 Execution block - every time update is required 3 4 Initiate Handshake Handshake successful 1 2
  • 7. Publisher/ Subsriber Model (Pub-Sub) Publisher (Salesforce) Account updates New Payments New Credits Subscriber 1 Subscriber 2 Subscriber 3 Subscriber N ……
  • 8. Example Use Cases Real time dashboards Real time notifications
  • 11. Push Topic - Query - SOQL query qualifying a message - NotifyForFields - Specify Fields which qualify to generate a push message - Valid Values: All, Referenced (default), Select, Where - NotifyForOperations – specify which operations qualify to generate a push message - Valid Values: All (default), Create, Extended, Update What is a Push Topic
  • 12. Salesforce Streaming API Library – under the hood - Javascript based API to internally handle complexity of connecting to Salesforce’s streaming API and provides a developer friendly way - Protocol – Bayeux - Defines how asynchronous messages should be transported - Messaging API - CometD - Implements Bayeux protocol to create subscription endpoints and handle message distribution - Streaming technique - Long Polling - Client sends a request to server - Server holds back response, untill a new message arrives
  • 13. Long Polling (under the hood) Server (Salesforce) Client (Browser) Salesforce Streaming API Library Long polling mechanism to open connection to server and allow server to wait and respond Handshake Subscribe New Message Push Notification
  • 15. Step 1 : Create Push Topic Push Topic - Query - SOQL query qualifying a message - NotifyForFields - Select - NotifyForOperations – All
  • 16. Step 2 : Initialize (handshake) Server (Salesforce) Client (Browser) 1 2
  • 17. Step 3 : Subscribe Server (Salesforce) Client (Browser) 3 4
  • 18. Step 4 : Handle Incoming Message Server (Salesforce) Client (Browser) 6
  • 19. • Trailhead - https://trailhead.salesforce.com/en/modules/api_basics/units/api_basics_streaming • Github (Demo source) – • DeveloperForce - https://developer.salesforce.com/page/Streaming_API • Streaming API Developer guide - https://developer.salesforce.com/docs/atlas.en- us.api_streaming.meta/api_streaming/intro_stream.htm Demo Source code https://github.com/toanshulverma/Demo-RealTimeAlerts Resources

Editor's Notes

  • #3: Two speaker title slide