The Streaming API, Force.com & You

If you haven't tried the Salesforce Streaming API, put it off no more. Here's a simple unmanaged package that does all the work for you, so you can bask in the glory of real time updates on the Salesforce Platform.

The Salesforce Streaming API has been out for a while, and it can do some crazy great things.

But have you — yes, you — have you actually tried it?

Unless you’ve had a specific use case, it’s possible that you, like me, had nodded along a bit and promised yourself you’d get to it when you had a few spare cycles.

Well my friend today is your lucky day, because I have created the simplest possible Streaming API Example for your enjoyment.

Getting started is easy:
 

  1. Make sure you are working in a developer org.
  2. Install the unmanaged package.
  3. Select the new app, LAB Streaming API Demo.
  4. Click the Insert a Push Topic Button.
  5. Login to the same account on a different browser and start inserting or updating accounts.

 

Voila!  You can now see the Streaming API in action.  Feel free to modify the code and play around as you like.  Try it with Opportunities instead of Accounts.  Try it with more fields.  (Be sure to update the PushTopic or insert new ones using the Dev Console or Workbench.) Put some processing on the front end rather than displaying it as is.  You get the idea.  You’ll also want to check out the docs for details on supported and unsupported query types.

And for next steps, be sure to check out the inimitable Pat Patterson’s Event Driven Programming session from DF11 to get more ideas on how you can use it.

Published
March 25, 2013

Leave your comments...

The Streaming API, Force.com & You