AJAX Longpolling
With ColdFusion 9 and BlazeDS
How to get started
AJAX Longpolling
with ColdFusion 9 and BlazeDS
Stephen Moretti
Software Development Manager
Enigma Interactive Ltd
http://www.enigma-interactive.co.uk
What am I talking about?
Quick introduction to Longpolling
How to set up a BlazeDS connection
Setting up the client and sending messages to the server
Sending messages to the client
Simple âchatâ application
Why Longpolling?
Refresh on reload
No timely response
Traditional polling
overhead of many hits to your web server and application
Push servers
Additional servers required
Specific clients such as java applets to manage connections
no text exists for this slide
Why Longpolling?
Longpolling
Single connection held open for a long time before being closed or given some data.
Can be implemented using a standard webserver
Not recommend â ties up worker threads leaving server unable to serve at all.
BlazeDS uses amf for communication
Generally faster than XML or JSON
no text exists for this slide
What do we need?
ColdFusion 9
BlazeDS
Flex/AJAX Bridge
Setting up BlazeDS
BlazeDS configuration under ColdFusion 9
Channel/Endpoint configuration
{installpath}\JRun4\servers\{servername}\cfusion-ear\cfusion-war\WEB-INF\flex\services-config.xml
Event Gateway
Gateway handler
Gateway instance
Connecting
BlazeDS Resources
http://opensource.adobe.com/svn/opensource/blazeds/branches/3.x/resources/fds-ajax-bridge/
Flex/Ajax Bridge â FABridge
Messaging Service library
Bridge Library
FABridge SWF
Messaging
Destination
Messaging-config.xml
Dynamic destination configuration
Producers
Allow you to send to the server
Consumers
Allow you to listen for messages
Message Filtering
Selectors
Single value
Subtopics
Delimited topics or events
user.app.hello
Contact Me
Stephen Moretti
Email/IM : Stephen.Moretti@gmail.com
Blog : http://nil.checksite.co.uk
Twitter : @mr_nil
A bunch of links
http://blog.programmableweb.com/2010/09/14/client-push-services-open-up-real-time-to-everyone/
http://www.dcooper.org/blog/client/index.cfm?mode=entry&entry=8E1439AD-4E22-1671-58710DD528E9C2E7
http://www.codfusion.com/blog/page.cfm/articles/introduction-to-blazeds
http://opensource.adobe.com/wiki/display/blazeds/Developer+Documentation
http://stackoverflow.com/questions/333664/simple-long-polling-example-code
http://nil.checksite.co.uk/index.cfm/BlazeDS