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:
- 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:
- 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.
- You could also read the endpoint URIs from a runtime config file or runtime parameters.
http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling
use:
http://localhost:8600/messagebroker/amfpolling
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);
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”
Leave a Reply









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
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
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.
[...] 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. [...]
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 ?
[...] 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. [...]
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!
Hi Sheng,
Create your project to compile on the server. That’s the only way I can get it to work.
hi nice site.
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!
[...] 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. [...]
[...] 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. [...]
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
[...] Follow any comments here with the RSS feed for this post. Post a comment or leave a trackback: Trackback URL. « Why Silverlight isn’timportant [...]
Order zanaflex….
Order zanaflex….
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 ?
Programma dlia rassilki obievlenii na forumi i blogi baza 170 000 forumov i blogov RU programma Xrumer 4.0! Stoimost 50$ ICQ 374551957
Buy Zanaflex online
[...] 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 [...]
great post once again
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
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….
skype
Soma online sales….
Soma online sales. Soma online next day….
Pattaya Bar Girls Salary…
Pattaya Bar Girls Salary…
Alessia Porn…
Alessia Porn…
Angel Stadium…
Angel Stadium…
Free Black Fat Ass Pussy…
Free Black Fat Ass Pussy…
Girls Mastubation Techiques…
Girls Mastubation Techiques…
Animal Sex…
Irish broadcaster providing news, articles, columns, photographs, and video on Gaelic sports,
…
Xxx Beastiality…
with ABC News Online and can be found here
…
attorney..
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
…
teddy…
He introduced his new invention by the end of 1928 under the name
…
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!
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…
Bestiality….
Free bestiality. Bestiality….
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….
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 ;)
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
[...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]
Incest….
Incest….
[...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]
[...] Christophe Coenraets :: Real Time Market Data using Apollo and Flex Data Services [...]