• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Extend - Retrieve data in real time with the Force.com streaming API
 

Extend - Retrieve data in real time with the Force.com streaming API

on

  • 7,337 views

 

Statistics

Views

Total Views
7,337
Views on SlideShare
7,337
Embed Views
0

Actions

Likes
0
Downloads
28
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Extend - Retrieve data in real time with the Force.com streaming API Extend - Retrieve data in real time with the Force.com streaming API Presentation Transcript

    • Retrieve Data in Real Time with theForce.com Streaming APIAlex ToussaintDirector, Platform API Servicesatoussaint@salesforce.com @alextoussaint
    • Safe HarborSafe 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 theassumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed orimplied by the forward-looking statements we make. All statements other than statements of historical fact could bedeemed forward-looking, including any projections of subscriber growth, earnings, revenues, or other financial items andany statements regarding strategies or plans of management for future operations, statements of belief, any statementsconcerning new, planned, or upgraded services or technology developments and customer contracts or use of ourservices.The risks and uncertainties referred to above include – but are not limited to – risks associated with developing anddelivering new functionality for our service, our new business model, our past operating losses, possible fluctuations inour operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, theoutcome of intellectual property and other litigation, risks associated with possible mergers and acquisitions, theimmature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivateour employees and manage our growth, new releases of our service and successful customer deployment, our limitedhistory reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Furtherinformation on potential factors that could affect the financial results of salesforce.com, inc. is included in our annualreport on Form 10-K for the most recent fiscal year ended January 31, 2010. This documents and others are availableon the SEC Filings section of the Investor Information section of our Web site.Any unreleased services or features referenced in this or other press releases or public statements are not currentlyavailable and may not be delivered on time or at all. Customers who purchase our services should make the purchasedecisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does notintend to update these forward-looking statements.
    • Agenda§  The world is going Real Time!§  Use Cases§  Streaming API§  Tips§  Q&A
    • Real-Time Force Initiative User Systems Integration(Client Apps, Social Feeds, High (Telco Apps, Internet of (Connecting Applications Fidelity Interaction) Things, ) and Data Sources)
    • Use Cases Call Center Integration Social Commerce &Enable Call Center Provide real time Power Social and AuctionsApps to provide real notifications and data Mobile apps to Enable Commercetime updates to updates from received streaming show real timeservice agents. Salesforce. updates for real time inventory and social data. promotion related Eliminate data polling required to information – synchronize data. JetStream.
    • Moving towards Real Time cloud SFDC: Real Time Services User Interaction Analytics Integration Internet of Presence things Collection of API Services
    • Streaming API
    • Based on Open Technologies §  Streaming API is GA! §  Using cometD – open client technology §  Relevancy matching is done within the save transaction – continuous queries –  Events are processed by each appserver in bulk, every ~3 seconds. –  Does not consume API call limits §  Start developing now! J
    • When would I use streaming?§  If you are currently polling our services –  Get data only when it changes§  To receive real-time notification of new or updated data –  Taking action on change in state – e.g. send alert –  Synchronize state – e.g. update page in browser
    • Streaming vs Polling§  Streaming §  Polling –  Client connects and –  Client must repeatedly call receives near real-time API updates –  SOAP/REST APIs –  Bayeux protocol –  Each poll consumes at –  It does not consume API least one API call (even if calls data not available you –  Count Events and pay) Connections
    • Streaming vs Triggers§  Streaming §  Trigger + future –  Client connects and –  Server must expose receives near real-time endpoint to receive updates messages (not firewall –  Client can be any app that friendly) can talk HTTP – server –  Trigger is executed on process, JavaScript in data modification; may call browser etc. web service via ‘future’ –  Bayeux protocol method –  SOAP/REST APIs
    • Streaming API - Lifecycle§  Administrator creates a topic based on a SOQL query –  Recommend wide queries for higher fidelity§  Client applications subscribe via the Bayeux protocol –  CometD library in several languages§  Client applications receive notifications on creates and updates that match Topic query§  One event may get generate and sent to N clients –  We count delivered events
    • Streaming API - Logical Flow Data Changes Processing Updates NotificationsSalesforce.com Account App Server 1.  Relevance Checks Contacts Manage 2.  Push Notification Processor Leads Subscriptions 3.  Event Dispatch Opportunities Send 4.  Query, CRUD, FLS SharingCustom Objects Updates
    • Create a topic§  Apex or API§  Create PushTopic standard object –  ApiVersion, Name, Query are required fields PushTopic pushTopic = new PushTopic(); pushTopic.ApiVersion = 2x.0; pushTopic.Name = ’NewContacts; pushtopic.Query = SELECT Id, Name, Email FROM Contact; insert pushTopic;
    • Subscribe via Bayeux protocol§  Endpoint https://hostname/cometd –  Hostname is Force.com instance URL or Visualforce server hostname§  MUST set sid (session ID) cookie on request $.cometd.init(https://c.na1.visual.force.com/ cometd); var subscription = $.cometd.subscribe(/NewContacts, function(message) { $(#content).append(<p>New record: + JSON.stringify(message.data.Name) + </p>); });
    • Bayeux Implementations§  CometD client libraries exist for JavaScript and Java – cometd.org§  Implementations also exist for other popular languages –  Ruby –  Node.js –  Dojo –  jQuery –  PHP –  Perl
    • Service Cloud & Streaming APIMichael RamseySr. Director, Salesforce - Service Cloud
    • Service Cloud ConsoleUniversal Desktop for the Social Enterprise Contextual •  Relevant •  Timely •  Sufficient Configurable Integrated UI and Component 3rd Party Application Framework & Data Integration Agent Push Experience Platform Avoid Navigating & & Integrate Partner & Searching Channel Solutions Productivity
    • Service Cloud ConsolePush Notifications§  Auto Refresh Enhanced List Views§  Visually Markup Rows and Columns§  Auto Refresh Detail Pages§  Insert Message to Alert Users to Changes
    • Spring ‘12Push Notifications: List Views GA
    • Spring ‘12Push Notifications: List Views GA
    • Spring ‘12Push Notifications: List Views GA
    • UCSF Customer Project
    • Chatter For Health Integration Architecture!
    • Chatter For Health Message Flow! 1.  Trigger creates “External_Message__c”" 1 record" 2.  Mule iON subscribes to Streaming API topic on “External_Message__c” Object 3.  Mule sets status on record to “In Progress”" 4.  Mule iON routes message to Amcom paging system or Twilio depending on 5 2 Destination__c field" 3 5.  Mule iON sends message back to Salesforce with “Sent” if successful or “Undelivered” if error, affixes error log" 4
    • Tips
    • Developing with Streaming API§  Leverage existing CometD libraries –  Existing Java, Javascript, Ruby, etc…§  Use Firebug or equivalent to help debug –  See the protocol in action, help learn behavior§  You can listen to multiple Topics at once –  One connection can listen to N topics§  Make wide queries allow for Sharing to filter –  Get all accounts, sharing will filter per user
    • Resources§  Force.com Streaming API –  http://developer.force.com§  Getting Started with the Force.com Streaming API –  http://wiki.developerforce.com/page/Streaming_API§  The Bayeux Protocol –  http://svn.cometd.com/trunk/bayeux/bayeux.html§  Discussion Groups –  http://boards.developerforce.com/t5/Streaming-API-Developer- Preview/bd-p/streamingapi
    • Need more limits – contact us!§  Customers may need more Events or Connections –  Contact Salesforce Support§  We are exploring increase overall limits for Streaming –  More Connections –  More Events –  What is your feedback?
    • Q&A
    • Thank You.