Real Time Market Data using Apollo and Flex Data Services

After the public alpha was released on Monday on labs, there has been a lot of interest in using Apollo together with the Flex Data Services. The combination of Apollo and FDS allows you, for example, to easily push data to Apollo applications, or to seamlessly integrate Apollo applications with Java back-ends using Remoting or the Flex Data Management Services.

As an example of an FDS-powered Apollo application, I created an Apollo version of my real time market data application available as part of the Flex Test Drive for Java Developers.

Download the client application here. (You can download the source code here).

The server-side remains unchanged… If you haven’t already done so, install the Flex Test Drive for Java Developers, and start the (fake) market data feed (http://localhost:8600/marketdata/startfeed.jsp).

In general, there are several strategies for configuring the FDS endpoints for your Apollo application:

  1. You can specify the endpoint URIs in services-config.xml. Note that when using Apollo, you can’t use tokens in the URI: you have to provide actual values for server name, context root, etc. For example, instead of:
  2. http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling
    use:
    http://localhost:8600/messagebroker/amfpolling

  3. The strategy used in the trader desktop application is to programmatically create the channels at the client-side based on endpoint URIs provided by the user.
  4. To look at the connection logic of the application, open traderdesktop.mxml and look at the following code in the connect() method:

    var rtmpChannel:RTMPChannel = new RTMPChannel("my-rtmp", rtmpEndpoint.text);
    var amfChannel:AMFChannel = new AMFChannel("my-polling-amf", amfEndpoint.text);
    amfChannel.pollingEnabled = true;
    amfChannel.pollingInterval = 2000;
    var channelSet:ChannelSet = new ChannelSet();
    channelSet.addChannel(rtmpChannel);
    channelSet.addChannel(amfChannel);
  5. You could also read the endpoint URIs from a runtime config file or runtime parameters.

This sample application is almost 100% identical to the browser version. I’ll continue to extend it by improving the UI, and using some specific Apollo APIs such as network detection and file IO to save data locally.

Comments

53 Responses to “Real Time Market Data using Apollo and Flex Data Services”

  1. Sheng on March 24th, 2007 4:01 am

    Nice idea. I try to create an Apollo project with your source code. How should I configure the FDS setting? Should I point to the Test Drive Server? Since the project is using the server-config.xml for compilation, I get an error of “Unexpected attribute ‘url’ found in ‘endpoint’ from file: services-config.xml” because this file is from the server.

    I am a little confused now. Any hint? Thanks

  2. Sheng on March 24th, 2007 4:19 am

    Sorry, it maybe a stupid question.
    When I create a Flex FDS project, I have two options: to compile it locally or compile it on the server.

    Normally I just compile it on the server, then compiler knows where to find service-config.xml during compilation in the background. So that is why in FlexBuilder the “additional compilter augument” field is empty.

    Using your code to create the Apollo project, since we need to support [Managed] metatag, I should create a Apollo project with FDS support. But in FlexBuilder, there are not two options anymore, which should be right, because Apollo application is desktop application, not running in FDS/LCDS server. So an compilation option appears in the Apollo project propeties, which linking to a service-config.xml file. But FlexBuilder shows an error of “Unexpected attribute ‘url’ found in ‘endpoint’ from file: services-config.xml” which I cannot even finish compilation. As what you have said, your code is dynamically creating endpoint URIs. So that means the compilation parameter with service-config.xml is not needed. I try also to delete this compilation parameter. Then the whole apollo application cannot run. It is reasonable there are more parameter in service-config.xml are needed for compilation.

    But what should I do now for the error? Can you tell us what other configurations are needed for using your source code?

    Thanks a lot

  3. unf on March 26th, 2007 1:01 am

    Good sample but looks like it works just with mx.messaging.Consumer and mx.messaging.Producer. The question is - how to connect mx.data.Dataservice from desktop to server? There is no channelSet property for DataService.

  4. MadeInFlex » Blog Archive » Apollo y Flex Data Services on March 27th, 2007 3:04 am

    [...] Christophe Coenraets ha escrito una entrada en su blog donde de cómo integrar Apollo y FDS, podeis ver la entrada Real Time Market Data using Apollo and Flex Data Services, donde crea una versión Apollo de una de sus aplicaciones ejemplo dentro su Flex Test Drive for Java Developers. [...]

  5. Rokesh on March 29th, 2007 4:52 am

    Hi Christoph,

    I really liked your presentation on QCON a few weeks ago. I could really tell you are very good at what you do. My compliment for that.

    I have a question though: I some environments like banks etc Flash plugin is disabled in the browser (security wise). How can we still use this technology with this security restriction ?

  6. Christophe Coenraets » Synchronizing Data in Apollo using Flex Data Services on March 30th, 2007 2:54 pm

    [...] In my previous post, I provided an example of an Apollo application using the Flex Message Service. Since then, a number of people have asked for examples of Apollo applications accessing data using the Flex Data Management services. So here is a simple Contact Management application that demonstrates this integration. [...]

  7. Sheng on March 30th, 2007 7:42 pm

    why no one is responding me? I think this is a general issue whenever we choose “compile application locally in flex builder” with flex data service.

    I have been googled for solution for such a long time and nothing coming up. I am wasting a lot of time. Is it my flexbuilder problem? Why no documentation for this?

    Any one can offer some help? Thanks!

  8. footube42 on April 3rd, 2007 7:03 pm

    Hi Sheng,

    Create your project to compile on the server. That’s the only way I can get it to work.

  9. alex on April 13th, 2007 10:22 am

    hi nice site.

  10. Sohan on April 18th, 2007 6:10 am

    Hi Christophe,
    I stumbled upon this blog when I was trying to find a solution to an error i’m encountering while using FDS.
    Basically i’m modifying the Contact Manager FDS sample to use a ready SQL database but just replacing the MSAccess database with SQL DB throws a wierd error.
    I can get my ArrayCollection populated with data from the SQL server but each object is empty.
    My Java wrapper lists all the objects correctly before passing to Flex but somewhere they just break and come in Flex as empty objects.
    This only happens when using an SQL DB and not with an MS Access DB…everything else stays the same.
    The exact error it throws is
    The fill method with parameters ‘[Ljava.lang.Object;’ and destination ‘contacts’ returned null.

    I would appreciate if you can help me. Thanks!

  11. Christophe Coenraets » New MDI-style Trader Desktop with Flex and Apollo on May 1st, 2007 2:17 pm

    [...] I put together a new example of a Trader Desktop application built with Flex and running in Apollo or in a browser. This application features configurable watch lists and data visualization panels organized in an MDI-style user interface. This version simulates data changes at the client-side to allow you to experience the application locally without having to install the server-side. For a complete example focusing on the server-side, see this post. [...]

  12. joserod » Blog Archive » Apollo y FDS on May 10th, 2007 9:54 pm

    [...] Christophe Coenraets ha escrito una entrada en su blog donde explica cómo integrar Apollo y FDS, podeis ver la entrada Real Time Market Data using Apollo and Flex Data Services, donde crea una versión Apollo de una de sus aplicaciones ejemplo dentro su Flex Test Drive for Java Developers. [...]

  13. robert on June 14th, 2007 11:49 am

    hi all.

  14. Bambarbia Kirkudu on June 19th, 2007 12:59 pm

    Hi Christophe,
    A question for you since Adobe asks questions instead of answering…
    Thanks in advance!
    LiveCycle Data Services: do I really need to buy it? Builder includes single CPU license. Looks like I need just few jars which I currently installed on 2 double-core Opterons, under Apache Tomcat. Free of charge. With pull-based architecture I don’t need it at all; I want to try “synchronous” architecture (of course I’ll have TCP sockets limitation, very soon!).
    Thanks

  15. fezodltfcp on June 21st, 2007 10:29 pm

    Hello! Good Site! Thanks you! zgnixvskmxvleo

  16. Steve on July 18th, 2007 6:54 pm

    hello every body i really like what you do continu i’m here to help me too
    good luck all

  17. Randy on August 20th, 2007 1:55 pm

    - interested in discussing an exciting web application we are developing and would like to see if your interested in working with us on it. - feel free to contact me disrectly

  18. Ezmo Developer Blog » Pushing on with online pressence information on August 29th, 2007 11:58 pm

    [...] Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL. « Why Silverlight isn’timportant [...]

  19. Order zanaflex. on September 21st, 2007 11:38 pm

    Order zanaflex….

    Order zanaflex….

  20. Zvero on October 9th, 2007 2:21 am

    Example shows Error-message:
    Unexpected attribute ‘url’ found in ‘endpoint’ from file: services-config.xml.

    There seems to be confusion about this.
    url replaces deprecated uri since lcds 2.5.1.
    (http://help.adobe.com/en_US/livecycle/es/lcds_releasenotes.html)

    So what version of lcds is the example using ?

  21. MoreNarodyNaSait on November 23rd, 2007 9:41 pm

    Programma dlia rassilki obievlenii na forumi i blogi baza 170 000 forumov i blogov RU programma Xrumer 4.0! Stoimost 50$ ICQ 374551957

  22. Buy Zanaflex online on November 29th, 2007 9:56 pm
  23. Christophe Coenraets » Blog Archive » Offline Synchronization using AIR and LiveCycle Data Services on December 5th, 2007 12:47 pm

    [...] you will have to recompile the application. You can also provide the endpoints at runtime. See my previous post for more information on defining a [...]

  24. secretboy on February 12th, 2008 11:13 am

    great post once again

  25. bibins on February 14th, 2008 9:12 am

    Hi,

    there is a hot fix from adobe for the bug ‘unexpected url found’..
    get the fix - hotfix 2 from adobe site
    http://kb.adobe.com/selfservice/viewContent.do?externalId=kb402000

  26. Online casinos www.nodeposit-onlinecasinos.com. on February 17th, 2008 9:05 pm

    Free online casinos http://www.free-onlinecasinos.org….

    Online casinos american money. Online casinos. Online casinos no deposit. Free casinos online http://www.free-onlinecasinos.org. Free online casinos http://www.freeonline-casinos.net….

  27. skype on February 23rd, 2008 2:46 pm
  28. Soma online next day. on February 28th, 2008 7:11 pm

    Soma online sales….

    Soma online sales. Soma online next day….

  29. Anonymous on March 24th, 2008 6:06 am

    Pattaya Bar Girls Salary…

    Pattaya Bar Girls Salary…

  30. Anonymous on March 24th, 2008 6:06 am

    Alessia Porn…

    Alessia Porn…

  31. Anonymous on April 3rd, 2008 11:03 pm

    Angel Stadium…

    Angel Stadium…

  32. Anonymous on April 3rd, 2008 11:04 pm

    Free Black Fat Ass Pussy…

    Free Black Fat Ass Pussy…

  33. Anonymous on April 3rd, 2008 11:04 pm

    Girls Mastubation Techiques…

    Girls Mastubation Techiques…

  34. Dantae on April 5th, 2008 12:48 am

    Animal Sex…

    Irish broadcaster providing news, articles, columns, photographs, and video on Gaelic sports,

  35. Montrell on April 8th, 2008 10:07 am

    Xxx Beastiality…

    with ABC News Online and can be found here

  36. attorney on April 18th, 2008 1:14 pm

    attorney..

  37. Ambrosi on May 29th, 2008 9:00 pm

    teddy…

    Originally coined by the Dopyera brothers when they formed the Dobro Manufacturing Company, in time it came, in common language, to mean any resonator

  38. Geovanni on June 4th, 2008 12:44 am

    teddy…

    He introduced his new invention by the end of 1928 under the name

  39. LE TUAN ANH on June 13th, 2008 12:02 am

    Hi James,
    I have created a Desktop Application project with J2EE application server as your samples. But I’m using Flex 3.0 (release version), not Apollo. Therefore I have a error: “Channel definition, mx.messaging.channels.RTMPChannel, can not be found”.
    Can you give me a hand?
    Thanks!

  40. LE TUAN ANH on June 17th, 2008 2:09 am

    Hi Christophe,
    I have created a Desktop Application project with J2EE application server as your samples. But I’m using Flex 3.0 (release version), not Apollo. Therefore I have a error: “Channel definition, mx.messaging.channels.RTMPChannel, can not be found”.
    Can you give me a hand?
    Thanks!

  41. mario on July 2nd, 2008 5:49 am

    pfff So many spammers, someone should really do something about it…

  42. Bestiality. on July 7th, 2008 3:21 pm

    Bestiality….

    Free bestiality. Bestiality….

  43. Taboo incest forum. on July 21st, 2008 5:07 am

    Taboo incest forum inces….

    Incest taboo forum. Incest taboo wikipedia the free encyclopedia. Incest taboo. Incest taboo exclusive online incest community. Incest taboo chat. Taboo incest forum….

  44. How I fu-cked 6 women I met online last month on August 15th, 2008 2:27 am

    I will be visiting this area from time to time, this was a great read for me and I found it quite unique and interesting

  45. çet on August 22nd, 2008 6:46 am

    ThankS ;)

  46. chat on August 22nd, 2008 6:47 am

    Greet ;)

  47. sohbet on August 22nd, 2008 6:47 am

    güzel bilgiler teşekkürler ;)

  48. kev on August 22nd, 2008 10:08 am

    A relatively old post that’s still very useful! It helped me get BlazeDS going with the similar fix and also WeborbPHP.

    Thanks Christophe!

  49. العاب بنات جديدة on September 5th, 2008 8:00 pm

    thank you sir

  50. Adobe AIR « Flex Generation Weblog on October 14th, 2008 3:00 am

    [...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]

  51. Incest. on October 15th, 2008 3:44 am

    Incest….

    Incest….

  52. Adobe LCDS « SrikanthCreative Mind’s Weblog on October 27th, 2008 7:02 am

    [...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]

  53. dashboards « Adiflex’s Blog on October 29th, 2008 9:38 am

    [...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]

Leave a Reply