SlideShare a Scribd company logo
Build your first Real-Time App with
Streaming API

Hal Hildebrand
Vinod Mehra
Jeff Lai
Safe harbor
 Safe harbor statement under the Private Securities Litigation Reform Act of 1995:

 This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties
 materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results
 expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be
 deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other
 financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any
 statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.

 The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new
 functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our
 operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of
 intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we
 operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new
 releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization
 and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of
 salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This
 documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of
 our Web site.

 Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently
 available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based
 upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-
 looking statements.
Hal, Vinod, Jeff, Alex
Salesforce R&D
Before we begin

What you will need to follow along
    Have your DEV Org created and ready
    Install the Streaming Hands on Package
    See http://bit.ly/demo-setup for complete instructions
Note!
    Chrome browser support has a bug when showing maps!
Please use FireFox for this demo


                    See demo installation instructions at: http://bit.ly/demo-setup
What are we going to build

Build two scenarios
    Use geo location coordinates to plot Opportunities Real Time
      • Use browser based geo location to show where Opportunities taking place
      • Plot location on map based on Streaming API events
    Enable Real Time updates for a Leaderboard
      • Update page with sales results from different sales people
      • Use CometD to listen to Streaming API and get events




                     See demo installation instructions at: http://bit.ly/demo-setup
Short Introduction to Streaming

 •Clients concerned with changes in data
  • Data creation
  • Data update
 •Common solution is to poll for changes
  • Wastes resources on both client and server
 •Streaming API pushes changes to clients
  • Sets up continuous queries to monitor changes
  • JSON events describing changes
Demo Object Model

 Event Custom Object
   Central Mechanism for notifications
 Use Apex triggers to create Events
   When monitored objects are
      Created
      Updated

 Event Location
   Captures locations for events
Event Publishing Workflow

 Define triggers on entities
   Invoice
      • After update
      • After create
   Ticket
      • After create

 EventPublisher creates Event
Streaming Subscription Flow

 Event is published (created)
 EventUpdates topic query matches
 Javascript function notifyEvent() called
 Browser posts location information
   Rest call to create and add the
    EventLocation on the event
 Javascript function postLocation() called
Add Apex triggers to desired entities

 Tickets
 Invoices
 Opportunities
Streaming Push Topics

Create Push Topics to enable detection of events
    EventUpdates
      • SELECT Id, Name, Type__c, Timestamp__c, SObjectName__c, SObjectId__c
        FROM Event__c
    OpportunityWon
      • Select Id, OwnerId, Amount, isWon, StageName from Opportunity




                    See demo installation instructions at: http://bit.ly/demo-setup
Launch Workbench

Start Workbench to create a topic
    https://workbench.developerforce.com/login.php




                   See demo installation instructions at: http://bit.ly/demo-setup
View/Create Push Topics




             See demo installation instructions at: http://bit.ly/demo-setup
Getting GPS from Browser

Include Static Resources for CometD and get Coordinates
Plotting new deals on a map

Connect and subscribe to events to plot




                 See demo installation instructions at: http://bit.ly/demo-setup
Demo!
 Use your tablet, phone or laptop browser to login to your DE org
 Select the “Location Streaming” tab
 Open another browser tab, login to DE org
 Create a new ticket
 Location is pushed to the first tab
 Select “Events” tab
 Select event to see map with monitoring browser locations
 tagged
Build Your First Real-time App with the Streaming API
Leaderboard – Deals Page

Show deals the usual way
    WonDeal Page




                See demo installation instructions at: http://bit.ly/demo-setup
Leaderboard – Deals Page

Streaming Enabled




               See demo installation instructions at: http://bit.ly/demo-setup
Leaderboard – Deals Page with Streaming API

Add Streaming API
    CometD from Static Resources




                  See demo installation instructions at: http://bit.ly/demo-setup
Leaderboard – Deals Page with Streaming API

     Add Streaming API
             Connect
             Subscribe
             Listen to Topics




See demo installation instructions at: http://bit.ly/demo-setup
Build Your First Real-time App with the Streaming API

More Related Content

PPT
Edi Remittance Sample
PDF
Integrating Google Play Games
PPTX
Real Time Integration with Salesforce Platform Events
PDF
ISV Monthly Tech Enablement (August 2017)
POTX
Hands-on Workshop: Intermediate Development with Heroku and Force.com
PDF
モダンなイベント駆動型システム連携を学ぼう〜Platform Events 入門
PDF
Get Into Lightning Flow Development
PDF
Spring '14 Release Developer Preview Webinar
Edi Remittance Sample
Integrating Google Play Games
Real Time Integration with Salesforce Platform Events
ISV Monthly Tech Enablement (August 2017)
Hands-on Workshop: Intermediate Development with Heroku and Force.com
モダンなイベント駆動型システム連携を学ぼう〜Platform Events 入門
Get Into Lightning Flow Development
Spring '14 Release Developer Preview Webinar

Similar to Build Your First Real-time App with the Streaming API (20)

PPTX
Best Practices for Lightning Apps
PDF
Introduction to Heroku
PDF
Streaming API with Java
PDF
#DF17Recap series: Integrate apps easier with the Salesforce platform
PPTX
San Diego Salesforce User Group - Lightning Overview
PPTX
Summer '20 preview release overview-deck
PPT
Dreamforce 13 developer session: Introduction to Heroku
PDF
Salesforce platform session 2
PPTX
Trailhead live - Overview of Salesforce App Cloud
PPT
Business Mashups Best of the Web APIs
PDF
Salesforce.com API Series: Service Cloud Console Deep Dive
PPTX
Build and Package Lightning Components for Lightning Exchange
PDF
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
PDF
LWC Episode 3- Component Communication and Aura Interoperability
PPTX
Salesforce Streaming Api
PPTX
Trailhead in a Box & Winter 20 Release
PPTX
Suisse Romande SF DG - Lightning workshop
PPT
How Force.com developers do more in less time
PPTX
London Salesforce Developers TDX 20 Global Gathering
PPT
S-Controls for Dummies
Best Practices for Lightning Apps
Introduction to Heroku
Streaming API with Java
#DF17Recap series: Integrate apps easier with the Salesforce platform
San Diego Salesforce User Group - Lightning Overview
Summer '20 preview release overview-deck
Dreamforce 13 developer session: Introduction to Heroku
Salesforce platform session 2
Trailhead live - Overview of Salesforce App Cloud
Business Mashups Best of the Web APIs
Salesforce.com API Series: Service Cloud Console Deep Dive
Build and Package Lightning Components for Lightning Exchange
Java Tech & Tools | Deploying Java & Play Framework Apps to the Cloud | Sande...
LWC Episode 3- Component Communication and Aura Interoperability
Salesforce Streaming Api
Trailhead in a Box & Winter 20 Release
Suisse Romande SF DG - Lightning workshop
How Force.com developers do more in less time
London Salesforce Developers TDX 20 Global Gathering
S-Controls for Dummies
Ad

More from Salesforce Developers (20)

PDF
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
PDF
Maximizing Salesforce Lightning Experience and Lightning Component Performance
PDF
Local development with Open Source Base Components
PPTX
TrailheaDX India : Developer Highlights
PDF
Why developers shouldn’t miss TrailheaDX India
PPTX
CodeLive: Build Lightning Web Components faster with Local Development
PPTX
CodeLive: Converting Aura Components to Lightning Web Components
PPTX
Enterprise-grade UI with open source Lightning Web Components
PPTX
TrailheaDX and Summer '19: Developer Highlights
PDF
Live coding with LWC
PDF
Lightning web components - Episode 4 : Security and Testing
PDF
Lightning web components episode 2- work with salesforce data
PDF
Lightning web components - Episode 1 - An Introduction
PDF
Migrating CPQ to Advanced Calculator and JSQCP
PDF
Scale with Large Data Volumes and Big Objects in Salesforce
PDF
Replicate Salesforce Data in Real Time with Change Data Capture
PDF
Modern Development with Salesforce DX
PDF
Integrate CMS Content Into Lightning Communities with CMS Connect
PDF
Introduction to MuleSoft
PDF
Modern App Dev: Modular Development Strategies
Sample Gallery: Reference Code and Best Practices for Salesforce Developers
Maximizing Salesforce Lightning Experience and Lightning Component Performance
Local development with Open Source Base Components
TrailheaDX India : Developer Highlights
Why developers shouldn’t miss TrailheaDX India
CodeLive: Build Lightning Web Components faster with Local Development
CodeLive: Converting Aura Components to Lightning Web Components
Enterprise-grade UI with open source Lightning Web Components
TrailheaDX and Summer '19: Developer Highlights
Live coding with LWC
Lightning web components - Episode 4 : Security and Testing
Lightning web components episode 2- work with salesforce data
Lightning web components - Episode 1 - An Introduction
Migrating CPQ to Advanced Calculator and JSQCP
Scale with Large Data Volumes and Big Objects in Salesforce
Replicate Salesforce Data in Real Time with Change Data Capture
Modern Development with Salesforce DX
Integrate CMS Content Into Lightning Communities with CMS Connect
Introduction to MuleSoft
Modern App Dev: Modular Development Strategies
Ad

Build Your First Real-time App with the Streaming API

  • 1. Build your first Real-Time App with Streaming API Hal Hildebrand Vinod Mehra Jeff Lai
  • 2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-Q for the most recent fiscal quarter ended July 31, 2012. This documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward- looking statements.
  • 3. Hal, Vinod, Jeff, Alex Salesforce R&D
  • 4. Before we begin What you will need to follow along  Have your DEV Org created and ready  Install the Streaming Hands on Package  See http://bit.ly/demo-setup for complete instructions Note! Chrome browser support has a bug when showing maps! Please use FireFox for this demo See demo installation instructions at: http://bit.ly/demo-setup
  • 5. What are we going to build Build two scenarios  Use geo location coordinates to plot Opportunities Real Time • Use browser based geo location to show where Opportunities taking place • Plot location on map based on Streaming API events  Enable Real Time updates for a Leaderboard • Update page with sales results from different sales people • Use CometD to listen to Streaming API and get events See demo installation instructions at: http://bit.ly/demo-setup
  • 6. Short Introduction to Streaming •Clients concerned with changes in data • Data creation • Data update •Common solution is to poll for changes • Wastes resources on both client and server •Streaming API pushes changes to clients • Sets up continuous queries to monitor changes • JSON events describing changes
  • 7. Demo Object Model Event Custom Object  Central Mechanism for notifications Use Apex triggers to create Events  When monitored objects are  Created  Updated Event Location  Captures locations for events
  • 8. Event Publishing Workflow Define triggers on entities  Invoice • After update • After create  Ticket • After create EventPublisher creates Event
  • 9. Streaming Subscription Flow Event is published (created) EventUpdates topic query matches Javascript function notifyEvent() called Browser posts location information  Rest call to create and add the EventLocation on the event Javascript function postLocation() called
  • 10. Add Apex triggers to desired entities Tickets Invoices Opportunities
  • 11. Streaming Push Topics Create Push Topics to enable detection of events  EventUpdates • SELECT Id, Name, Type__c, Timestamp__c, SObjectName__c, SObjectId__c FROM Event__c  OpportunityWon • Select Id, OwnerId, Amount, isWon, StageName from Opportunity See demo installation instructions at: http://bit.ly/demo-setup
  • 12. Launch Workbench Start Workbench to create a topic  https://workbench.developerforce.com/login.php See demo installation instructions at: http://bit.ly/demo-setup
  • 13. View/Create Push Topics See demo installation instructions at: http://bit.ly/demo-setup
  • 14. Getting GPS from Browser Include Static Resources for CometD and get Coordinates
  • 15. Plotting new deals on a map Connect and subscribe to events to plot See demo installation instructions at: http://bit.ly/demo-setup
  • 16. Demo! Use your tablet, phone or laptop browser to login to your DE org Select the “Location Streaming” tab Open another browser tab, login to DE org Create a new ticket Location is pushed to the first tab Select “Events” tab Select event to see map with monitoring browser locations tagged
  • 18. Leaderboard – Deals Page Show deals the usual way  WonDeal Page See demo installation instructions at: http://bit.ly/demo-setup
  • 19. Leaderboard – Deals Page Streaming Enabled See demo installation instructions at: http://bit.ly/demo-setup
  • 20. Leaderboard – Deals Page with Streaming API Add Streaming API  CometD from Static Resources See demo installation instructions at: http://bit.ly/demo-setup
  • 21. Leaderboard – Deals Page with Streaming API Add Streaming API  Connect  Subscribe  Listen to Topics See demo installation instructions at: http://bit.ly/demo-setup