SlideShare a Scribd company logo
1 of 23
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

How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdf
How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdfHow to_ Salesforce CPQ_ Manage Renewals and Amendments.pdf
How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdfvictorothugadi
 
Webinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce OptimizerWebinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce OptimizerSalesforce Admins
 
Managing the Role Hierarchy at Enterprise Scale
Managing the Role Hierarchy at Enterprise ScaleManaging the Role Hierarchy at Enterprise Scale
Managing the Role Hierarchy at Enterprise ScaleSalesforce Developers
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelSalesforce Developers
 
Introduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorIntroduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorSalesforce Developers
 
Platform Events by Tim Taylor
Platform Events by Tim TaylorPlatform Events by Tim Taylor
Platform Events by Tim TaylorChristine Smith
 
Salesforce Development Best Practices
Salesforce Development Best PracticesSalesforce Development Best Practices
Salesforce Development Best PracticesVivek Chawla
 
Introduction to Salesforce UI API
Introduction to Salesforce UI APIIntroduction to Salesforce UI API
Introduction to Salesforce UI APIAtul Gupta(8X)
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsSalesforce Developers
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementSalesforce Developers
 
Sales Cloud Lightning Migration Best Practices (May 12, 2017)
Sales Cloud Lightning Migration Best Practices (May 12, 2017)Sales Cloud Lightning Migration Best Practices (May 12, 2017)
Sales Cloud Lightning Migration Best Practices (May 12, 2017)Salesforce Partners
 
Discover salesforce, dev ops and Copado CI/CD automations
Discover salesforce, dev ops and Copado CI/CD automationsDiscover salesforce, dev ops and Copado CI/CD automations
Discover salesforce, dev ops and Copado CI/CD automationsJackGuo20
 
Integration using Salesforce Canvas
Integration using Salesforce CanvasIntegration using Salesforce Canvas
Integration using Salesforce CanvasDhanik Sahni
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDhanik Sahni
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce PresentationChetna Purohit
 
Salesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ OverviewSalesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ OverviewHarshala Shewale ☁
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajYuvaraj P
 

What's hot (20)

How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdf
How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdfHow to_ Salesforce CPQ_ Manage Renewals and Amendments.pdf
How to_ Salesforce CPQ_ Manage Renewals and Amendments.pdf
 
Webinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce OptimizerWebinar: Take Control of Your Org with Salesforce Optimizer
Webinar: Take Control of Your Org with Salesforce Optimizer
 
Managing the Role Hierarchy at Enterprise Scale
Managing the Role Hierarchy at Enterprise ScaleManaging the Role Hierarchy at Enterprise Scale
Managing the Role Hierarchy at Enterprise Scale
 
Introduction to the Salesforce Security Model
Introduction to the Salesforce Security ModelIntroduction to the Salesforce Security Model
Introduction to the Salesforce Security Model
 
Introduction to External Objects and the OData Connector
Introduction to External Objects and the OData ConnectorIntroduction to External Objects and the OData Connector
Introduction to External Objects and the OData Connector
 
Platform Events by Tim Taylor
Platform Events by Tim TaylorPlatform Events by Tim Taylor
Platform Events by Tim Taylor
 
Deep Dive into Apex Triggers
Deep Dive into Apex TriggersDeep Dive into Apex Triggers
Deep Dive into Apex Triggers
 
Salesforce Development Best Practices
Salesforce Development Best PracticesSalesforce Development Best Practices
Salesforce Development Best Practices
 
Introduction to Apex Triggers
Introduction to Apex TriggersIntroduction to Apex Triggers
Introduction to Apex Triggers
 
Introduction to Salesforce UI API
Introduction to Salesforce UI APIIntroduction to Salesforce UI API
Introduction to Salesforce UI API
 
Real Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform EventsReal Time Integration with Salesforce Platform Events
Real Time Integration with Salesforce Platform Events
 
From Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release ManagementFrom Sandbox To Production: An Introduction to Salesforce Release Management
From Sandbox To Production: An Introduction to Salesforce Release Management
 
Sales Cloud Lightning Migration Best Practices (May 12, 2017)
Sales Cloud Lightning Migration Best Practices (May 12, 2017)Sales Cloud Lightning Migration Best Practices (May 12, 2017)
Sales Cloud Lightning Migration Best Practices (May 12, 2017)
 
Discover salesforce, dev ops and Copado CI/CD automations
Discover salesforce, dev ops and Copado CI/CD automationsDiscover salesforce, dev ops and Copado CI/CD automations
Discover salesforce, dev ops and Copado CI/CD automations
 
Salesforce APIs
Salesforce APIsSalesforce APIs
Salesforce APIs
 
Integration using Salesforce Canvas
Integration using Salesforce CanvasIntegration using Salesforce Canvas
Integration using Salesforce Canvas
 
Deep dive into Salesforce Connected App
Deep dive into Salesforce Connected AppDeep dive into Salesforce Connected App
Deep dive into Salesforce Connected App
 
Salesforce Presentation
Salesforce PresentationSalesforce Presentation
Salesforce Presentation
 
Salesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ OverviewSalesforce Steelbrick CPQ Overview
Salesforce Steelbrick CPQ Overview
 
Salesforce CPQ by yuvaraj
Salesforce CPQ by yuvarajSalesforce CPQ by yuvaraj
Salesforce CPQ by yuvaraj
 

Similar to Salesforce Streaming event - PushTopic and Generic Events

February 2020 Salesforce API Review
February 2020 Salesforce API ReviewFebruary 2020 Salesforce API Review
February 2020 Salesforce API ReviewLydon Bergin
 
Control your world using the Salesforce1 Platform (IoT)
Control your world using the Salesforce1 Platform (IoT)Control your world using the Salesforce1 Platform (IoT)
Control your world using the Salesforce1 Platform (IoT)InternetCreations
 
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast Iron
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast IronIntegrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast Iron
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast IronProlifics
 
Integrating SFDC and Oracle ERP with IBM Websphere CastIron Appliance
Integrating SFDC and Oracle ERP with IBM Websphere CastIron ApplianceIntegrating SFDC and Oracle ERP with IBM Websphere CastIron Appliance
Integrating SFDC and Oracle ERP with IBM Websphere CastIron ApplianceSandeep Chellingi
 
ISV Monthly Tech Enablement (August 2017)
ISV Monthly Tech Enablement (August 2017)ISV Monthly Tech Enablement (August 2017)
ISV Monthly Tech Enablement (August 2017)Salesforce Partners
 
Durable Streaming and Enterprise Messaging
Durable Streaming and Enterprise MessagingDurable Streaming and Enterprise Messaging
Durable Streaming and Enterprise MessagingSalesforce Developers
 
Forcelandia 2018 - Create lively lightning components with streaming api
Forcelandia 2018 - Create lively lightning components with streaming apiForcelandia 2018 - Create lively lightning components with streaming api
Forcelandia 2018 - Create lively lightning components with streaming apiAnshul Verma
 
Unlocking the Power of Salesforce Integrations with Confluent
Unlocking the Power of Salesforce Integrations with ConfluentUnlocking the Power of Salesforce Integrations with Confluent
Unlocking the Power of Salesforce Integrations with ConfluentAaronLieberman5
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsDreamforce
 
JDF18 - Connecting the customer success platform
JDF18 - Connecting the customer success platformJDF18 - Connecting the customer success platform
JDF18 - Connecting the customer success platformDeepu Chacko
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Appsdreamforce2006
 
Doctor Flow- Best practices Microsoft flow - Techorama 2019
Doctor Flow- Best practices Microsoft flow - Techorama 2019Doctor Flow- Best practices Microsoft flow - Techorama 2019
Doctor Flow- Best practices Microsoft flow - Techorama 2019serge luca
 
Elevate workshop programmatic_2014
Elevate workshop programmatic_2014Elevate workshop programmatic_2014
Elevate workshop programmatic_2014David Scruggs
 
Streaming in the Wild with Apache Flink
Streaming in the Wild with Apache FlinkStreaming in the Wild with Apache Flink
Streaming in the Wild with Apache FlinkKostas Tzoumas
 
3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...DevOps.com
 
Enterprise API New Features and Roadmap
Enterprise API New Features and RoadmapEnterprise API New Features and Roadmap
Enterprise API New Features and RoadmapSalesforce Developers
 
Partner Connect APAC - 2022 - April
Partner Connect APAC - 2022 - AprilPartner Connect APAC - 2022 - April
Partner Connect APAC - 2022 - Aprilconfluent
 
Living the DevOps Dream: Self-Managed Application Environments-as-a-Service
Living the DevOps Dream: Self-Managed Application Environments-as-a-ServiceLiving the DevOps Dream: Self-Managed Application Environments-as-a-Service
Living the DevOps Dream: Self-Managed Application Environments-as-a-ServiceVictoria Livschitz
 
20110514 PMI San Diego Keynote
20110514 PMI San Diego Keynote20110514 PMI San Diego Keynote
20110514 PMI San Diego KeynotePeter Coffee
 

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

No Refresh Needed
No Refresh NeededNo Refresh Needed
No Refresh Needed
 
February 2020 Salesforce API Review
February 2020 Salesforce API ReviewFebruary 2020 Salesforce API Review
February 2020 Salesforce API Review
 
Control your world using the Salesforce1 Platform (IoT)
Control your world using the Salesforce1 Platform (IoT)Control your world using the Salesforce1 Platform (IoT)
Control your world using the Salesforce1 Platform (IoT)
 
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast Iron
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast IronIntegrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast Iron
Integrating Salesforce.com and Oracle ERP Using IBM WebSphere Cast Iron
 
Integrating SFDC and Oracle ERP with IBM Websphere CastIron Appliance
Integrating SFDC and Oracle ERP with IBM Websphere CastIron ApplianceIntegrating SFDC and Oracle ERP with IBM Websphere CastIron Appliance
Integrating SFDC and Oracle ERP with IBM Websphere CastIron Appliance
 
ISV Monthly Tech Enablement (August 2017)
ISV Monthly Tech Enablement (August 2017)ISV Monthly Tech Enablement (August 2017)
ISV Monthly Tech Enablement (August 2017)
 
Durable Streaming and Enterprise Messaging
Durable Streaming and Enterprise MessagingDurable Streaming and Enterprise Messaging
Durable Streaming and Enterprise Messaging
 
Forcelandia 2018 - Create lively lightning components with streaming api
Forcelandia 2018 - Create lively lightning components with streaming apiForcelandia 2018 - Create lively lightning components with streaming api
Forcelandia 2018 - Create lively lightning components with streaming api
 
Unlocking the Power of Salesforce Integrations with Confluent
Unlocking the Power of Salesforce Integrations with ConfluentUnlocking the Power of Salesforce Integrations with Confluent
Unlocking the Power of Salesforce Integrations with Confluent
 
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible AppsOur API Evolution: From Metadata to Tooling API for Building Incredible Apps
Our API Evolution: From Metadata to Tooling API for Building Incredible Apps
 
JDF18 - Connecting the customer success platform
JDF18 - Connecting the customer success platformJDF18 - Connecting the customer success platform
JDF18 - Connecting the customer success platform
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Apps
 
Doctor Flow- Best practices Microsoft flow - Techorama 2019
Doctor Flow- Best practices Microsoft flow - Techorama 2019Doctor Flow- Best practices Microsoft flow - Techorama 2019
Doctor Flow- Best practices Microsoft flow - Techorama 2019
 
Elevate workshop programmatic_2014
Elevate workshop programmatic_2014Elevate workshop programmatic_2014
Elevate workshop programmatic_2014
 
Streaming in the Wild with Apache Flink
Streaming in the Wild with Apache FlinkStreaming in the Wild with Apache Flink
Streaming in the Wild with Apache Flink
 
3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...3 reasons to pick a time series platform for monitoring dev ops driven contai...
3 reasons to pick a time series platform for monitoring dev ops driven contai...
 
Enterprise API New Features and Roadmap
Enterprise API New Features and RoadmapEnterprise API New Features and Roadmap
Enterprise API New Features and Roadmap
 
Partner Connect APAC - 2022 - April
Partner Connect APAC - 2022 - AprilPartner Connect APAC - 2022 - April
Partner Connect APAC - 2022 - April
 
Living the DevOps Dream: Self-Managed Application Environments-as-a-Service
Living the DevOps Dream: Self-Managed Application Environments-as-a-ServiceLiving the DevOps Dream: Self-Managed Application Environments-as-a-Service
Living the DevOps Dream: Self-Managed Application Environments-as-a-Service
 
20110514 PMI San Diego Keynote
20110514 PMI San Diego Keynote20110514 PMI San Diego Keynote
20110514 PMI San Diego Keynote
 

Recently uploaded

Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...caitlingebhard1
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)Samir Dash
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseWSO2
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMKumar Satyam
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAnitaRaj43
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard37
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaWSO2
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 

Recently uploaded (20)

Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Navigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern EnterpriseNavigating Identity and Access Management in the Modern Enterprise
Navigating Identity and Access Management in the Modern Enterprise
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Modernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using BallerinaModernizing Legacy Systems Using Ballerina
Modernizing Legacy Systems Using Ballerina
 
Choreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software EngineeringChoreo: Empowering the Future of Enterprise Software Engineering
Choreo: Empowering the Future of Enterprise Software Engineering
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 

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