SlideShare une entreprise Scribd logo
1  sur  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.

Contenu connexe

Tendances

Tendances (20)

Integrating with salesforce
Integrating with salesforceIntegrating with salesforce
Integrating with salesforce
 
Salesforce Lightning workshop
Salesforce Lightning workshopSalesforce Lightning workshop
Salesforce Lightning workshop
 
Building Mobile Apps on Salesforce Platform with Mobile SDK
Building Mobile Apps on Salesforce Platform with Mobile SDKBuilding Mobile Apps on Salesforce Platform with Mobile SDK
Building Mobile Apps on Salesforce Platform with Mobile SDK
 
Architect day 20181128 - Afternoon Session
Architect day 20181128 - Afternoon SessionArchitect day 20181128 - Afternoon Session
Architect day 20181128 - Afternoon Session
 
Introducing the Salesforce platform
Introducing the Salesforce platformIntroducing the Salesforce platform
Introducing the Salesforce platform
 
Salesforce Intro
Salesforce IntroSalesforce Intro
Salesforce Intro
 
Best Practices for Team Development in a Single Org
Best Practices for Team Development in a Single OrgBest Practices for Team Development in a Single Org
Best Practices for Team Development in a Single Org
 
Salesforce REST API
Salesforce  REST API Salesforce  REST API
Salesforce REST API
 
Platform Events by Tim Taylor
Platform Events by Tim TaylorPlatform Events by Tim Taylor
Platform Events by Tim Taylor
 
Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2Salesforce intro session_for_students_v2
Salesforce intro session_for_students_v2
 
Salesforce 101
Salesforce 101Salesforce 101
Salesforce 101
 
Lightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An IntroductionLightning web components - Episode 1 - An Introduction
Lightning web components - Episode 1 - An Introduction
 
Integrating with salesforce using platform events
Integrating with salesforce using platform eventsIntegrating with salesforce using platform events
Integrating with salesforce using platform events
 
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce IntroductionSalesforce Tutorial for Beginners: Basic Salesforce Introduction
Salesforce Tutorial for Beginners: Basic Salesforce Introduction
 
Replicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data CaptureReplicate Salesforce Data in Real Time with Change Data Capture
Replicate Salesforce Data in Real Time with Change Data Capture
 
Architecting Multi-Org Solutions
Architecting Multi-Org SolutionsArchitecting Multi-Org Solutions
Architecting Multi-Org Solutions
 
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
 
SAP and Salesforce Integration
SAP and Salesforce IntegrationSAP and Salesforce Integration
SAP and Salesforce Integration
 
Lwc presentation
Lwc presentationLwc presentation
Lwc presentation
 
Salesforce Overview For Beginners/Students
Salesforce Overview For Beginners/StudentsSalesforce Overview For Beginners/Students
Salesforce Overview For Beginners/Students
 

Similaire à Salesforce Streaming event - PushTopic and Generic Events

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
AaronLieberman5
 
Intro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite AppsIntro to AppExchange - Building Composite Apps
Intro to AppExchange - Building Composite Apps
dreamforce2006
 
Elevate workshop programmatic_2014
Elevate workshop programmatic_2014Elevate workshop programmatic_2014
Elevate workshop programmatic_2014
David Scruggs
 

Similaire à 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
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

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