SlideShare a Scribd company logo
Streaming API-PushTopic
and Generic Events
SalesforceCodex.com 1
SalesforceCodex.com 2
About Me
Dhanik Lal Sahni
Technical Architect
Conduent Business Solution
Certified Application Architect
Twitter : @dhaniksahni
Blog : salesforcecodex.com
SalesforceCodex.com 3
Session 11-Agenda
• In a given scenario, recommend when to use API-based
integrations, such as SOAP, REST, Bulk, Streaming, Canvas,
Workflow outbound, APEX (Callouts, @ future, etc.), and
Lightning Connect to achieve business requirements.
• Compare and contrast the advantages and drawbacks (design
trade-offs) of using API-based integrations such as SOAP, REST,
Bulk, Streaming, Canvas, Workflow outbound, APEX (Callouts,
@future, etc.), and Lightning Connect.
28%
17%
15%
10%
15%
10%
5%
Integration Architecture
Designer Exam
1 2 3 4 5 6 7
Salesforce Integration Capabilities:: 28%
SalesforceCodex.com 4
AGENDA
• What is Streaming Event?
• Push vs Pull Technology
• Short Vs Long Polling
• Overview of Push Topic
• Overview of Generic Events
• Streaming Events Comparison
• Use Cases
SalesforceCodex.com 5
Streaming API
• Streaming API enables transmitting of real time data from Salesforce Platform
• Transmission of data done using push technology
• Push technology transfers information that is initiated from a server to the client.
• Provides a subscription mechanism for receiving events in near real time.
• Push technology also called the publish/subscribe model
Push Topic
Generic Event Platform Event
Change Data Capture
L
e
g
a
c
y
C
u
r
r
e
n
t
SalesforceCodex.com 6
STREAMING API USAGE
Platform to External App Platform to PlatformExternal App to Platform
SalesforceCodex.com 7
STREAMING EVENT TECHNOLOGY
Pull Technology
Push Technology • Notifications are sent to the subscriber in real time.
• No pooling required.
• Clients request data from the server periodically.
• Clients poll the server for data updates, and freshness of data depends on the
poll frequency.
• Clients can make excessive calls and cause server slowdown.
SalesforceCodex.com 8
MECHANISM OF STREAMING API
Short Polling
Long Polling
• Clients send requests for information but with the expectation the server may
not respond immediately.
• Server respond when data is changed for object
• Long polling supported using Bayeux Protocol or CometD
• Client keeps sending request to make active connection
• To enable Publisher/Subscriber model, active connection is required between Salesforce and each client
SalesforceCodex.com 9
PUSH TOPIC
PushTopic events provide a secure and scalable way to receive
notifications for changes to Salesforce data that match a SOQL query
you define.
Use PushTopic events to:
Receive notifications of Salesforce record changes, including create, update, delete, and undelete
operations.
Capture changes for the fields and records that match a SOQL query.
Receive change notifications for only the records a user has access to based on sharing
rules.
SalesforceCodex.com 10
PUSH TOPIC
Create PushTopic PushTopic Name
PushTopic inserted
in database
Notification
condition/event
• All
• Referenced(default)
• Select
• Where
SOQL Query
SalesforceCodex.com 11
PUSH TOPIC SECURITY
• To receive notification user must have access to object
• Field Level Access required
• Only record where user has access will be returned
SalesforceCodex.com 12
Considerations - Multiple Notifications in Same Transaction
Streaming API Notifications
Sent in Reverse Order Within a
Transaction
• In general, event notifications are delivered in the order of record changes.
• When a record triggers multiple notifications within the same transaction, the
last notifications are delivered first.
Multiple Streaming API
Notifications for the Same
Record and Untracked Fields
If field change triggers other field changes on the same record, more
notifications are sent for those fields.
Only Last PushTopic
Notification Sent for the Same
Record
When multiple PushTopic notifications are generated for the same record within
about one millisecond and in the same transaction, only the last notification is
sent.
SalesforceCodex.com 13
PushTopic Streaming Allocation
Description Performance and
Unlimited Editions
Enterprise
Edition
All other supported
editions
Maximum number of topics (PushTopic records) per org 100 50 40
Maximum number of concurrent clients (subscribers)
across all channels and for all event types
2,000 1,000 20
Maximum number of delivered event notifications within
a 24-hour period, shared by all CometD clients
1,000,000 200,000 50,000 (10,000 for
free orgs)
Socket timeout during connection (CometD session) 110 seconds 110 seconds 110 seconds
Timeout to reconnect after successful connection
(keepalive)
40 seconds 40 seconds 40 seconds
Maximum length of the SOQL query in the Query field of
a PushTopic record
1,300 characters 1,300 characters 1,300 characters
Maximum length for a PushTopic name 25 characters 25 characters 25 char
SalesforceCodex.com 14
GENERIC EVENTS
Use generic events to send custom notifications that are not tied to
Salesforce data changes.
Use Generic Events to:
Publish and receive arbitrary payloads in JSON without a predefined event schema
Broadcast notifications to a target set of users, specific teams, or your entire org
Send notifications for events that are external to Salesforce
SalesforceCodex.com 15
HOW TO USE GENERIC EVENTS
1. A StreamingChannel that defines the channel, with a name that is case-sensitive
2. It is object and can be accessed from app menusStreaming Channel
Clients
Streaming Channel
Push REST API
One or more clients subscribed to the channel
Streaming Channel Push REST API to monitor and invoke push events on the
channel
SalesforceCodex.com 16
USE CASE -1
Robert is developing a custom app for a client, which is used by the
client’s service reps and displays a feed of case records from
Salesforce
Requirement:
• The feed stays up-to-date and displays the latest changes from Salesforce without the
need for reps to click the Refresh button.
• If a new case is assigned to a rep, the case is added to the feed.
• If the status or subject of a case is changed, the data is refreshed in the case feed.
• If a case is escalated, a red exclamation point is added to the case in the feed.
Stream Events to use : PushTopic
SalesforceCodex.com 17
USE CASE -2
Robert’s client wants a custom app that lets its users place orders for
parts.
Requirement:
• When a user places an order through the Salesforce app, the app notifies the external
parts supplier service.
• When the supplier ships the parts order, the Salesforce app is notified, posts a message
in Chatter, and updates a case.
Stream Events to use : Platform events
SalesforceCodex.com 18
USE CASE -3
Robert wants to develop an app for service reps that display
notification messages that the service rep manager sends from a
console app in Salesforce.
Example:
Robert’s manager can send notifications to specific reps about important events, such as
system maintenance announcements or warnings of a rep’s low number of resolved cases.
Stream Events to use : Generic Events
SalesforceCodex.com 19
USE CASE -4
Robert’s client wants an integration that synchronizes Salesforce
record data changes with their HR system, which is external to
Salesforce.
Example:
1. Every new or changed Employee__c record is replicated in the HR data store.
2. All Employee__c records are replicated along with their fields.
3. The replication is transaction-based. If multiple updates are in a single transaction, the
integration app sends these updates as part of one transaction as well.
4. If the data replication process fails, it’s possible to resume the replication from past event
notifications that are stored for up to three days.
Stream Events to use : Change Data Capture
SalesforceCodex.com 20
STREAMING EVENT - FEATURE COMPARISON
SalesforceCodex.com 21
STREAMING EVENT - FEATURE COMPARISON
salesforcecodex.com 22
Share some inspiring words about
@salesforcecodex on twitter
salesforcecodex.com 23
Keep Exploring. Keep Learning.

More Related Content

What's hot (20)

PPTX
Data model in salesforce
Chamil Madusanka
 
PDF
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
PPTX
Introducing the Salesforce platform
John Stevenson
 
PDF
Salesforce Marketing Cloud overview demo
Adama Sidibé
 
PPTX
Salesforce Development Best Practices
Vivek Chawla
 
PPTX
Integrating with salesforce using platform events
Amit Chaudhary
 
PPTX
Salesforce Online Training
Keylabs
 
PPTX
Salesforce admin training 1
HungPham381
 
PDF
Lwc presentation
Nithesh N
 
PPTX
Salesforce Deck Template
Phil Weinmeister
 
PPTX
What Is Salesforce CRM? | Salesforce CRM Tutorial For Beginners | Salesforce ...
Edureka!
 
PPTX
Salesforce marketing cloud
ajay raz
 
PPT
Salesforce Integration
Joshua Hoskins
 
PPTX
Salesforce Service Cloud Training | Salesforce Training For Beginners - Servi...
Edureka!
 
PPTX
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
Edureka!
 
PPTX
Salesforce Marketing cloud
Cloud Analogy
 
PPTX
Integrating with salesforce
Mark Adcock
 
PPTX
Salesforce intro session_for_students_v2
Stephen Edache Paul
 
PDF
DevOps Center_ArchitectGroup
AmeyKulkarni84
 
PDF
Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...
Edureka!
 
Data model in salesforce
Chamil Madusanka
 
Best Practices with Apex in 2022.pdf
Mohith Shrivastava
 
Introducing the Salesforce platform
John Stevenson
 
Salesforce Marketing Cloud overview demo
Adama Sidibé
 
Salesforce Development Best Practices
Vivek Chawla
 
Integrating with salesforce using platform events
Amit Chaudhary
 
Salesforce Online Training
Keylabs
 
Salesforce admin training 1
HungPham381
 
Lwc presentation
Nithesh N
 
Salesforce Deck Template
Phil Weinmeister
 
What Is Salesforce CRM? | Salesforce CRM Tutorial For Beginners | Salesforce ...
Edureka!
 
Salesforce marketing cloud
ajay raz
 
Salesforce Integration
Joshua Hoskins
 
Salesforce Service Cloud Training | Salesforce Training For Beginners - Servi...
Edureka!
 
What Is Salesforce? | Salesforce Training - What Does Salesforce Do? | Salesf...
Edureka!
 
Salesforce Marketing cloud
Cloud Analogy
 
Integrating with salesforce
Mark Adcock
 
Salesforce intro session_for_students_v2
Stephen Edache Paul
 
DevOps Center_ArchitectGroup
AmeyKulkarni84
 
Introduction to Salesforce | Salesforce Tutorial for Beginners | Salesforce T...
Edureka!
 

Similar to Salesforce Streaming event - PushTopic and Generic Events (20)

PPTX
MuleSoft Meetup São Paulo #4 - November
Guilherme Pereira Silva
 
PPTX
Chandigarh MuleSoft Meetup #3
Lalit Panwar
 
PPTX
The Integrations Behind Connecting With Salesforce
AaronLieberman5
 
PDF
Platform events
arun jain
 
PPTX
Power of salesforce LWC with Mulesoft using platform events
pqrs1234
 
PDF
ISV Monthly Tech Enablement (August 2017)
Salesforce Partners
 
PDF
MuleSoft Online Meetup - Salesforce Streaming APIs
Royston Lobo
 
PDF
ESPL implementing scalable salesforce integrations for enterprises v1.3
Eternus Solutions
 
PDF
Designing Salesforce Platform Events
CodeScience
 
PDF
Durable Streaming and Enterprise Messaging
Salesforce Developers
 
PPTX
Unlocking the Power of Salesforce Integrations with Confluent
AaronLieberman5
 
PPTX
Power of LWC + Mulesoft
NeerajKumar1965
 
PPTX
Forcelandia 2018 - Create lively lightning components with streaming api
Anshul Verma
 
PDF
Simplifying Integrations With Salesforce? How to elevate customer relationshi...
Cyntexa
 
PDF
TrailheaDX 2019 : Explore New Frontiers with High Volume Platform Events
John Brock
 
PPTX
Salesforce Miami User Group Event - 1st Quarter 2024
SkyPlanner
 
PPTX
Publish and subscribe platform events using flows
KadharBashaJ
 
PDF
Dreamwares_Salesforce Updated
Amit Ahuja
 
PPTX
Learn MOAR Winter '20 Developer Community
Federico Giust
 
PPTX
February 2020 Salesforce API Review
Lydon Bergin
 
MuleSoft Meetup São Paulo #4 - November
Guilherme Pereira Silva
 
Chandigarh MuleSoft Meetup #3
Lalit Panwar
 
The Integrations Behind Connecting With Salesforce
AaronLieberman5
 
Platform events
arun jain
 
Power of salesforce LWC with Mulesoft using platform events
pqrs1234
 
ISV Monthly Tech Enablement (August 2017)
Salesforce Partners
 
MuleSoft Online Meetup - Salesforce Streaming APIs
Royston Lobo
 
ESPL implementing scalable salesforce integrations for enterprises v1.3
Eternus Solutions
 
Designing Salesforce Platform Events
CodeScience
 
Durable Streaming and Enterprise Messaging
Salesforce Developers
 
Unlocking the Power of Salesforce Integrations with Confluent
AaronLieberman5
 
Power of LWC + Mulesoft
NeerajKumar1965
 
Forcelandia 2018 - Create lively lightning components with streaming api
Anshul Verma
 
Simplifying Integrations With Salesforce? How to elevate customer relationshi...
Cyntexa
 
TrailheaDX 2019 : Explore New Frontiers with High Volume Platform Events
John Brock
 
Salesforce Miami User Group Event - 1st Quarter 2024
SkyPlanner
 
Publish and subscribe platform events using flows
KadharBashaJ
 
Dreamwares_Salesforce Updated
Amit Ahuja
 
Learn MOAR Winter '20 Developer Community
Federico Giust
 
February 2020 Salesforce API Review
Lydon Bergin
 
Ad

Recently uploaded (20)

PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PPT
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PPTX
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Ericsson LTE presentation SEMINAR 2010.ppt
npat3
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Digital Circuits, important subject in CS
contactparinay1
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
NASA A Researcher’s Guide to International Space Station : Physical Sciences ...
Dr. PANKAJ DHUSSA
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Seamless Tech Experiences Showcasing Cross-Platform App Design.pptx
presentifyai
 
Ad

Salesforce Streaming event - PushTopic and Generic Events

  • 1. Streaming API-PushTopic and Generic Events SalesforceCodex.com 1
  • 2. SalesforceCodex.com 2 About Me Dhanik Lal Sahni Technical Architect Conduent Business Solution Certified Application Architect Twitter : @dhaniksahni Blog : salesforcecodex.com
  • 3. SalesforceCodex.com 3 Session 11-Agenda • In a given scenario, recommend when to use API-based integrations, such as SOAP, REST, Bulk, Streaming, Canvas, Workflow outbound, APEX (Callouts, @ future, etc.), and Lightning Connect to achieve business requirements. • Compare and contrast the advantages and drawbacks (design trade-offs) of using API-based integrations such as SOAP, REST, Bulk, Streaming, Canvas, Workflow outbound, APEX (Callouts, @future, etc.), and Lightning Connect. 28% 17% 15% 10% 15% 10% 5% Integration Architecture Designer Exam 1 2 3 4 5 6 7 Salesforce Integration Capabilities:: 28%
  • 4. SalesforceCodex.com 4 AGENDA • What is Streaming Event? • Push vs Pull Technology • Short Vs Long Polling • Overview of Push Topic • Overview of Generic Events • Streaming Events Comparison • Use Cases
  • 5. SalesforceCodex.com 5 Streaming API • Streaming API enables transmitting of real time data from Salesforce Platform • Transmission of data done using push technology • Push technology transfers information that is initiated from a server to the client. • Provides a subscription mechanism for receiving events in near real time. • Push technology also called the publish/subscribe model Push Topic Generic Event Platform Event Change Data Capture L e g a c y C u r r e n t
  • 6. SalesforceCodex.com 6 STREAMING API USAGE Platform to External App Platform to PlatformExternal App to Platform
  • 7. SalesforceCodex.com 7 STREAMING EVENT TECHNOLOGY Pull Technology Push Technology • Notifications are sent to the subscriber in real time. • No pooling required. • Clients request data from the server periodically. • Clients poll the server for data updates, and freshness of data depends on the poll frequency. • Clients can make excessive calls and cause server slowdown.
  • 8. SalesforceCodex.com 8 MECHANISM OF STREAMING API Short Polling Long Polling • Clients send requests for information but with the expectation the server may not respond immediately. • Server respond when data is changed for object • Long polling supported using Bayeux Protocol or CometD • Client keeps sending request to make active connection • To enable Publisher/Subscriber model, active connection is required between Salesforce and each client
  • 9. SalesforceCodex.com 9 PUSH TOPIC PushTopic events provide a secure and scalable way to receive notifications for changes to Salesforce data that match a SOQL query you define. Use PushTopic events to: Receive notifications of Salesforce record changes, including create, update, delete, and undelete operations. Capture changes for the fields and records that match a SOQL query. Receive change notifications for only the records a user has access to based on sharing rules.
  • 10. SalesforceCodex.com 10 PUSH TOPIC Create PushTopic PushTopic Name PushTopic inserted in database Notification condition/event • All • Referenced(default) • Select • Where SOQL Query
  • 11. SalesforceCodex.com 11 PUSH TOPIC SECURITY • To receive notification user must have access to object • Field Level Access required • Only record where user has access will be returned
  • 12. SalesforceCodex.com 12 Considerations - Multiple Notifications in Same Transaction Streaming API Notifications Sent in Reverse Order Within a Transaction • In general, event notifications are delivered in the order of record changes. • When a record triggers multiple notifications within the same transaction, the last notifications are delivered first. Multiple Streaming API Notifications for the Same Record and Untracked Fields If field change triggers other field changes on the same record, more notifications are sent for those fields. Only Last PushTopic Notification Sent for the Same Record When multiple PushTopic notifications are generated for the same record within about one millisecond and in the same transaction, only the last notification is sent.
  • 13. SalesforceCodex.com 13 PushTopic Streaming Allocation Description Performance and Unlimited Editions Enterprise Edition All other supported editions Maximum number of topics (PushTopic records) per org 100 50 40 Maximum number of concurrent clients (subscribers) across all channels and for all event types 2,000 1,000 20 Maximum number of delivered event notifications within a 24-hour period, shared by all CometD clients 1,000,000 200,000 50,000 (10,000 for free orgs) Socket timeout during connection (CometD session) 110 seconds 110 seconds 110 seconds Timeout to reconnect after successful connection (keepalive) 40 seconds 40 seconds 40 seconds Maximum length of the SOQL query in the Query field of a PushTopic record 1,300 characters 1,300 characters 1,300 characters Maximum length for a PushTopic name 25 characters 25 characters 25 char
  • 14. SalesforceCodex.com 14 GENERIC EVENTS Use generic events to send custom notifications that are not tied to Salesforce data changes. Use Generic Events to: Publish and receive arbitrary payloads in JSON without a predefined event schema Broadcast notifications to a target set of users, specific teams, or your entire org Send notifications for events that are external to Salesforce
  • 15. SalesforceCodex.com 15 HOW TO USE GENERIC EVENTS 1. A StreamingChannel that defines the channel, with a name that is case-sensitive 2. It is object and can be accessed from app menusStreaming Channel Clients Streaming Channel Push REST API One or more clients subscribed to the channel Streaming Channel Push REST API to monitor and invoke push events on the channel
  • 16. SalesforceCodex.com 16 USE CASE -1 Robert is developing a custom app for a client, which is used by the client’s service reps and displays a feed of case records from Salesforce Requirement: • The feed stays up-to-date and displays the latest changes from Salesforce without the need for reps to click the Refresh button. • If a new case is assigned to a rep, the case is added to the feed. • If the status or subject of a case is changed, the data is refreshed in the case feed. • If a case is escalated, a red exclamation point is added to the case in the feed. Stream Events to use : PushTopic
  • 17. SalesforceCodex.com 17 USE CASE -2 Robert’s client wants a custom app that lets its users place orders for parts. Requirement: • When a user places an order through the Salesforce app, the app notifies the external parts supplier service. • When the supplier ships the parts order, the Salesforce app is notified, posts a message in Chatter, and updates a case. Stream Events to use : Platform events
  • 18. SalesforceCodex.com 18 USE CASE -3 Robert wants to develop an app for service reps that display notification messages that the service rep manager sends from a console app in Salesforce. Example: Robert’s manager can send notifications to specific reps about important events, such as system maintenance announcements or warnings of a rep’s low number of resolved cases. Stream Events to use : Generic Events
  • 19. SalesforceCodex.com 19 USE CASE -4 Robert’s client wants an integration that synchronizes Salesforce record data changes with their HR system, which is external to Salesforce. Example: 1. Every new or changed Employee__c record is replicated in the HR data store. 2. All Employee__c records are replicated along with their fields. 3. The replication is transaction-based. If multiple updates are in a single transaction, the integration app sends these updates as part of one transaction as well. 4. If the data replication process fails, it’s possible to resume the replication from past event notifications that are stored for up to three days. Stream Events to use : Change Data Capture
  • 22. salesforcecodex.com 22 Share some inspiring words about @salesforcecodex on twitter