| By Christophe Coenraets | Article Rating: |
|
| August 8, 2007 09:15 AM EDT | Reads: |
30,322 |
(July 14, 2006) - Some people take the dog for a walk, others go play a round of golf. Not Christophe Coenraets. His idea of a good time is to illustrate Flex 2 / JMS integration by extending a simple "realtime feed" application that he built a while back! Web Developer's & Designer's Journal is proud to bring you each month two of the month's best tips from Adobe's intrepid Flex Hero.
Flex and JMS: Real Time Market Data Application
The Message Service at the core of the Flex Data Services (http://labs.adobe.com/technologies/flexdata_services2/) is one of the important new features in Flex 2. (see Figure 1)
Unlike JMS, the Flex Message Service provides an actual implementation of a publish/subscribe messaging system, not just an API. It might be all you need for simple, self contained use cases where you just want to exchange messages between Flex clients. In Enterprise integration scenarios, the Flex message service integrates with, and extends existing messaging systems to allow thin clients to publish and subscribe to topics these systems manage. Flex integrates with existing messaging systems through an adapter architecture. Using the JMS adapter available out-of-the box, you can map Flex destinations to JMS topics. For example, the snippet below (added to flex-message-service.xml) defines a destination called "stock-feed", and maps it to a JMS topic called "FlexTopic".
<destination id="stock-feed">
<properties>
<server>
<durable>false</durable>
<durable-store-manager>flex.messaging.durability.FileStoreManager</durable-store-manager>
</server>
<jms>
<destination-type>Topic</destination-type>
<message-type>javax.jms.TextMessage</message-type>
<connection-factory>jms/flex/TopicConnectionFactory</connection-factory>
<destination-jndi-name>jms/topic/flex/simpletopic</destination-jndi-name>
<destination-name>FlexTopic</destination-name>
<durable-consumers>false</durable-consumers>
<delivery-mode>NON_PERSISTENT</delivery-mode>
<message-priority>DEFAULT_PRIORITY</message-priority>
<acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
<transacted-sessions>false</transacted-sessions>
</jms>
</properties>
<channels>
<channel ref="my-rtmp"/>
</channels>
<adapter ref="jms"/>
</destination>
This mapping allows Flex clients to publish and subscribe to the JMS topic. For example, the following line of code is all you need in your Flex client to subscribe to the "stock-feed" destination:
<mx:Consumer id="consumer" destination="stock-feed" message="messageHandler(event)"/>
To illustrate the Flex and JMS integration, I recently spent some time extending the simple "realtime feed" application that I built a while back as a sample shipping with the Flex Data Services. This new version looks more like a real trading application: A Java application publishes simulated real time market data to a JMS topic. The Flex client subscribes to that topic and displays the data in a DataGrid and in a Line Chart that are updated in real time.
Action Points
- Run the application*: http http://coenraets.com/apps/portfolio/portfolio.html
(NOTE: Since my host doesn't provide JMS hosting, this version simulates data at the client-side).
*This application requires Flash Player 8.5 beta 3 available from http://labs.adobe.com/.
- Download the full JMS version of the application (Flex code + Java code):
http://coenraets.com/apps/portfolio/portfoliojms.zip - Read more about the Message Service and the Flex Data Services in my FDS overview on Adobe Labs:
http://labs.adobe.com/wiki/index.php/Flex_Enterprise_Services:overview
As an example of AJAX/Flex integration, I built a simple collaboration module that you could add on top of any AJAX (or Flex) application. In this example, I chose to add it on top of Google Maps. (see Figure 2)
The Flex module adds the following collaboration features to Google Maps:
- Map sharing: Maps are kept in sync (in real time) between users involved in a collaboration session.
- Videoconferencing (Webcam sharing and VOIP): You can share your Webcam and microphone to add video and audio to your collaboration session.
- Whiteboarding: Collaborating users can draw on the map. For example you could draw potential directions, etc. The users' whiteboards are kept in sync in real time.
- Cursor sharing: When you move your mouse, other users see the movements of your mouse and what you are pointing at.
- Publish/subscribe messaging and support for real-time communication
- Drawing API
- Support for Webcam/voice capture and streaming (Flash Media Server is required for streaming).
- Run a simplified* version of the application**: http://coenraets.com/apps/flexmaps/flexmaps.html
*Real time messaging (used for map sharing and whiteboard synchronization) has been disabled in this version.
**This application requires Flash Player 8.5 beta 2 available from http://labs.adobe.com/.
- Download the full version of the application: http://coenraets.com/apps/flexmaps/flexmaps.html
Published August 8, 2007 Reads 30,322
Copyright © 2007 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Christophe Coenraets
Christophe Coenraets currently works as a Senior Technical Evangelist at Adobe. Before joining Adobe, Christophe was an evangelist at Macromedia, focusing on Rich Internet Applications and Enterprise integration. Prior to Macromedia, Christophe was the head of Java and J2EE Technical Evangelism at Sybase, where he started working on Java Enterprise projects in 1996. Before joining Sybase in the US, Christophe held different positions at Powersoft in Belgium, including Principal Consultant for PowerBuilder, and Manager of the Professional Services organization. Before joining Powersoft, Christophe worked as a developer and architect on several retail and BPM projects. Christophe has been a regular speaker at conferences worldwide for the last 10 years.
![]() |
Roelof 09/05/07 10:43:48 AM EDT | |||
Nice post, but could you please fix the examples. Both links give a 404 error! Cheers |
||||
![]() |
Anupam 08/16/07 02:50:32 AM EDT | |||
I got an 404 error while clicking on the link :( Please update it! Cheers! |
||||
![]() |
Abhishek 08/07/07 09:22:24 AM EDT | |||
The links for the examples(both JMS and Maps) are not accessible .... |
||||
![]() |
Web Developer's & Designer's Journal 07/20/06 01:52:04 PM EDT | |||
Some people take the dog for a walk, others go play a round of golf. Not Christophe Coenraets. His idea of a good time is to illustrate Flex 2 / JMS integration by extending a simple 'realtime feed' application that he built a while back! Web Developer's & Designer's Journal is proud to bring you each month two of the month's best tips from Adobe's intrepid Flex Hero. |
||||
![]() |
Web Developer's & Designer's Journal 07/17/06 10:45:42 AM EDT | |||
Some people take the dog for a walk, others go play a round of golf. Not Christophe Coenraets. His idea of a good time is to illustrate Flex 2 / JMS integration by extending a simple 'realtime feed' application that he built a while back! Web Developer's & Designer's Journal is proud to bring you each month two of the month's best tips from Adobe's intrepid Flex Hero. |
||||
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Adobe Flex Developer Earns $100K in New York City
- Adobe May Cooperate with Apple to Transplant Flash Player to iPhone
- Ph.D. in Twitter Anyone?
- Eolas Sues the Internet
- Adobe LiveCycle Enterprise Suite 2 for Cloud Computing
- Adobe Betas Target RIAs and Cloud Computing
- Special Report on the Emerging Cloud Computing Trend
- Adobe Cans Another 9% of its Workforce
- My Thoughts on Ulitzer
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Ulitzer Live! New Media Conference & Expo
- Adobe’s Aiming ColdFusion at Multiple Clouds
- Eval JavaScript in a Global Context
- Fig Leaf Software to Exhibit at Government IT Conference & Expo
- Cloud Executives Feature on Cloud Computing Expo Power Panel
- Software Flexibility in the Cloud - Part 4 of 5
- Cloud Computing Journal: Adobe to Deliver ColdFusion in the Cloud
- Is Microsoft as Free as Open Source?
- Adobe Reader Sued
- Adobe Unveils LiveCycle Enterprise Suite 2 for Deployment in the Cloud
- Where Are RIA Technologies Headed in 2008?
- Cover Story: How to Increase the Frame Rates of Your Flash Movies
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Your First Adobe Flex Application with a ColdFusion Backend
- Adobe Flex 2: Advanced DataGrid
- i-Technology Blog: Death-Knell For "Rich Media? Hardly!
- Adobe/Macromedia - Microsoft, Look Out!
- How To Create a Photo Slide Show ...
- Adobe Flex Interface Customization - Themes, Styles, Skins
- Personal Branding Checklist
- Has the Technology Bounceback Begun?
- "Real-World Flex" by Adobe's Christophe Coenraets





































