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.

68 Responses to Real Time Market Data using Apollo and Flex Data Services

  1. Sheng March 24, 2007 at 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 March 24, 2007 at 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 March 26, 2007 at 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. Rokesh March 29, 2007 at 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 ?

  5. Sheng March 30, 2007 at 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!

  6. footube42 April 3, 2007 at 7:03 pm #

    Hi Sheng,

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

  7. alex April 13, 2007 at 10:22 am #

    hi nice site.

  8. Sohan April 18, 2007 at 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!

  9. robert June 14, 2007 at 11:49 am #

    hi all.

  10. Bambarbia Kirkudu June 19, 2007 at 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

  11. fezodltfcp June 21, 2007 at 10:29 pm #

    Hello! Good Site! Thanks you! zgnixvskmxvleo

  12. Steve July 18, 2007 at 6:54 pm #

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

  13. Randy August 20, 2007 at 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

  14. Zvero October 9, 2007 at 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 ?

  15. MoreNarodyNaSait November 23, 2007 at 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

  16. Buy Zanaflex online November 29, 2007 at 9:56 pm #

    Buy Zanaflex online

  17. secretboy February 12, 2008 at 11:13 am #

    great post once again

  18. bibins February 14, 2008 at 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

  19. skype February 23, 2008 at 2:46 pm #

    skype

  20. attorney April 18, 2008 at 1:14 pm #

    attorney..

  21. LE TUAN ANH June 13, 2008 at 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!

  22. LE TUAN ANH June 17, 2008 at 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!

  23. mario July 2, 2008 at 5:49 am #

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

  24. 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

  25. çet August 22, 2008 at 6:46 am #

    ThankS ;)

  26. chat August 22, 2008 at 6:47 am #

    Greet ;)

  27. sohbet August 22, 2008 at 6:47 am #

    güzel bilgiler teşekkürler ;)

  28. kev August 22, 2008 at 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!

  29. العاب بنات جديدة September 5, 2008 at 8:00 pm #

    thank you sir

  30. Srinivas Sanga June 4, 2009 at 4:14 am #

    Hi,
    In LCDS,

    is view synchoronise with database changes with extenal batch file?

    If not , let me know any possible solution for this case.

  31. Арчи October 1, 2009 at 2:34 am #

    Ну а когда по нескольких блогам одно и то же лупят, это вообще сказка. К чему так палиться?

  32. марина October 6, 2009 at 2:18 am #

    Появились боты, размещающие комменты со вставленными невидимыми ссылками на раскручиваемые сайты. Мне пришел такой коммент с текстом буддистской притчи.

  33. Fiona Anaheim July 26, 2010 at 2:35 pm #

    Thanks for sharing the client application.

  34. matbaa August 8, 2010 at 8:24 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!

  35. kablo tv October 9, 2010 at 12:14 pm #

    thanks very nice this

  36. maviajansmatbaa September 16, 2011 at 11:37 am #

    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 wit

  37. Kablonet September 20, 2011 at 9:42 am #

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

  38. Uydunet February 22, 2012 at 1:32 pm #

    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….
    Kablo TV – Uydunet

  39. Kablo TV February 22, 2012 at 1:32 pm #

    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….

  40. Malena Aveado June 21, 2014 at 1:31 am #

    Right here is the right blog for anyone who really wants to find out about this topic. You realize so much its almost hard to argue with you (not that I personally would want to

  41. klima servisi August 23, 2014 at 6:11 pm #

    Güzel çalışma ellerinize sağlık Başarılarının devamını dilerim

Trackbacks/Pingbacks

  1. MadeInFlex » Blog Archive » Apollo y Flex Data Services - March 27, 2007

    [...] 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. [...]

  2. Christophe Coenraets » Synchronizing Data in Apollo using Flex Data Services - March 30, 2007

    [...] 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. [...]

  3. Christophe Coenraets » New MDI-style Trader Desktop with Flex and Apollo - May 1, 2007

    [...] 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. [...]

  4. joserod » Blog Archive » Apollo y FDS - May 10, 2007

    [...] 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. [...]

  5. Ezmo Developer Blog » Pushing on with online pressence information - August 29, 2007

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

  6. Order zanaflex. - September 21, 2007

    Order zanaflex….

    Order zanaflex….

  7. Christophe Coenraets » Blog Archive » Offline Synchronization using AIR and LiveCycle Data Services - December 5, 2007

    [...] 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 [...]

  8. Online casinos www.nodeposit-onlinecasinos.com. - February 17, 2008

    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….

  9. Soma online next day. - February 28, 2008

    Soma online sales….

    Soma online sales. Soma online next day….

  10. Anonymous - March 24, 2008

    Pattaya Bar Girls Salary…

    Pattaya Bar Girls Salary…

  11. Anonymous - March 24, 2008

    Alessia Porn…

    Alessia Porn…

  12. Anonymous - April 3, 2008

    Angel Stadium…

    Angel Stadium…

  13. Anonymous - April 3, 2008

    Free Black Fat Ass Pussy…

    Free Black Fat Ass Pussy…

  14. Anonymous - April 3, 2008

    Girls Mastubation Techiques…

    Girls Mastubation Techiques…

  15. Dantae - April 5, 2008

    Animal Sex…

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

  16. Montrell - April 8, 2008

    Xxx Beastiality…

    with ABC News Online and can be found here

  17. Ambrosi - May 29, 2008

    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

  18. Geovanni - June 4, 2008

    teddy…

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

  19. Bestiality. - July 7, 2008

    Bestiality….

    Free bestiality. Bestiality….

  20. Taboo incest forum. - July 21, 2008

    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….

  21. Adobe AIR « Flex Generation Weblog - October 14, 2008

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

  22. Incest. - October 15, 2008

    Incest….

    Incest….

  23. Adobe LCDS « SrikanthCreative Mind’s Weblog - October 27, 2008

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

  24. dashboards « Adiflex’s Blog - October 29, 2008

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

  25. Adalt dating. - December 30, 2010

    Adalt dating….

    Adalt dating….

  26. pgware superram v6 10 4 2010 portable 9 - May 16, 2011

    pgware superram v6 10 4 2010 portable 9…

    pgware superram v6 10 4 2010 portable 9…

Leave a Reply

css.php