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.

  • Sheng

    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

  • Sheng

    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

  • unf

    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.

  • Pingback: MadeInFlex » Blog Archive » Apollo y Flex Data Services()

  • Rokesh

    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 ?

  • Pingback: Christophe Coenraets » Synchronizing Data in Apollo using Flex Data Services()

  • Sheng

    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!

  • footube42

    Hi Sheng,

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

  • hi nice site.

  • Sohan

    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!

  • Pingback: Christophe Coenraets » New MDI-style Trader Desktop with Flex and Apollo()

  • Pingback: joserod » Blog Archive » Apollo y FDS()

  • hi all.

  • 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

  • Hello! Good Site! Thanks you! zgnixvskmxvleo

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

  • – 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

  • Pingback: Ezmo Developer Blog » Pushing on with online pressence information()

  • Pingback: Order zanaflex.()

  • Zvero

    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 ?

  • MoreNarodyNaSait

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

  • Pingback: Christophe Coenraets » Blog Archive » Offline Synchronization using AIR and LiveCycle Data Services()

  • great post once again

  • bibins

    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

  • Pingback: Online casinos www.nodeposit-onlinecasinos.com.()

  • Pingback: Soma online next day.()

  • Pingback: Anonymous()

  • Pingback: Anonymous()

  • Pingback: Anonymous()

  • Pingback: Anonymous()

  • Pingback: Anonymous()

  • Pingback: Dantae()

  • Pingback: Montrell()

  • attorney..

  • Pingback: Ambrosi()

  • Pingback: Geovanni()

  • LE TUAN ANH

    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!

  • LE TUAN ANH

    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!

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

  • Pingback: Bestiality.()

  • Pingback: Taboo incest forum.()

  • 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

  • ThankS ;)

  • Greet ;)

  • güzel bilgiler teşekkürler ;)

  • kev

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

    Thanks Christophe!

  • thank you sir

  • Pingback: Adobe AIR « Flex Generation Weblog()

  • Pingback: Incest.()

  • Pingback: Adobe LCDS « SrikanthCreative Mind’s Weblog()

  • Pingback: dashboards « Adiflex’s Blog()

  • Srinivas Sanga

    Hi,
    In LCDS,

    is view synchoronise with database changes with extenal batch file?

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

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

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

  • Thanks for sharing the client application.

  • 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!

  • thanks very nice this

  • Pingback: Adalt dating.()

  • Pingback: pgware superram v6 10 4 2010 portable 9()

  • 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

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

  • 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

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

  • Классная бибтека особенно “Альманах попаданцев от А до Я”

  • 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

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

  • chiller ve klima kampanyalarında devrim yaratan http://www.sogutmaservisiistanbul.com sitesi kaçırmayın.

  • Thanks for this great article.

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

  • I would also suggest that the picture icon (the icon that appears to the left of the video when it appears in the search list) be something that really sets itself apart so visually people are attracted to it.

  • Seems obvious but this takes some thought to get into the minds of users similar to keyword discovery.

  • seri üretim,fiyat uygunluğu ve kaliteli üretim bizlerde.
    http://www.jonsunsport.com/spor-coraplari.html

  • Merhaba, ingilizce cevam yazmazsak olur mu. Türksat Fiber İnternet Uydunet Kablonet

css.php