Robert, thanks for the reply and your interest in helping. I really appreciate
it.
The points consist of a Date (x axis) and a number (y axis)
They are passed as an array (for each axis) of DataPoint objects (a simple
custom class with 2 variables) from
java. These are then assigned to an arraycollection in Flex which becomes the
dataprovider for an axis.
There have been some problems with the queries themselves. Before they were
returning the entire data set
each time, but now they have been modified to only bring in new data. So
updates should have very small
data sets and shouldn't be slow. Still, the initial load when the user
launches the application is extremely slow
even when it doesn't crash.
The charts need to be updated frequently with new data which will be pushed
from the server to anyone
subscribed to that channel. Currently I'm broadcasting the data every 30
seconds just to test it. I'm not sure if
I have BlazeDS configured properly, but here is a sample from my messaging
config file of the relevant entries:
<adapters>
<adapter-definition id="actionscript"
class="flex.messaging.services.messaging.adapters.ActionScriptAdapter"
default="true" />
<adapter-definition id="Gateway" class="factory.ReportManager"/>
</adapters>
<default-channels>
<channel ref="my-streaming-amf"/>
<channel ref="my-polling-amf"/>
</default-channels>
<destination id="factory">
<adapter ref="Gateway"/>
<channels>
<channel ref="my-polling-amf"/>
<channel ref="my-streaming-amf"/>
</channels>
</destination>
I wrote a custom ServiceAdapter in Java to process the messages. I send the
data from the java classes to my
flex app which is subscribed to this channel.
<mx:Consumer id="consumer" destination="factory"
message="messageHandler(event.message)"/>
and later of course:
consumer.subscribe();
I've found out since my last post that If I don't draw the chart, the data
actually gets transfered fairly quickly
and never locks up, so it seems like it is more of a charting issue than it is
the fault of blazeds. Also
yesterday, the browser was locking up whenever I sent more than 50K records or
so, but for some reason
today it is no longer locking up. The database info/query has changed slightly
but that is all that is different
but the flex code is fundamentally unchanged as far as the message handling and
chart drawing code.
One thing I am also doing which may cause a problem is that I am generating the
chart in actionscript. I can't
do it in MXML because the chart type is defined by the server info which gets
sent. So they may want a bar
chart or a pie chart or whatever. This particular plot is a multi-axis chart
with a line for one axis and a plot
series for the other.
I did check out the searchcoders app and it is indeed very responsive and
impressive. I hope I can get this
application somewhere near that level! I will also look into the presentation
by Tom Jordahl. Thanks again for
all of the help. Let me know if you have any further ideas or insights.
--- In [email protected], "Robert Cadena" <[EMAIL PROTECTED]> wrote:
>
> hey nd,
>
> let me ask you a couple of questions and maybe we can figure out where the
> problems are.
>
> * how are the points you are sending represented? Are they maybe Point
> objects in java, mapped to Point objects in AS? Is it, instead, a Point
> "result set", for example, with an array of number or int types and then
> these are converted on the client into a format that the graph can digest?
>
> * how are you using the "realtime" messaging on BlazeDS? Does your app
> actually require that you send/receive messages in realtime, meaning server
> push? perhaps you're sending/receiving the whole data set without having
> to.
>
> * which channel are you using to transmit information and what is the
> interval at which it gets transmitted?
>
> * are you sending the entire data set or just deltas?
>
> * what adapter are you using on the backend? And what is the return type on
> the methods you are calling?
>
> * Have you determined which part is locking up the client? For example, have
> you timed the request/response without displaying the results to see what
> the elapsed time is? And, do you have dummy data on the client that you can
> pass to your graphing methods to determine if graphing is the problem?
>
> You can see an example of a high-traffic
> data-transfer-from-blazeds-to-flex-scheme on app I built called the
> SearchCoders/Dashboard: http://www.searchcoders.com/ download the AIR
> version and give it a try. We send 100 email messages to the client in just
> a few milliseconds. The application runs on one instance of BlazeDS
> configured on the non-polling AMF over HTTP channel. If you do a search
> for something that is likely to have a ton of messages --so, search for
> adobe-- and you scroll through the thousands of results, you'll notice a
> small delay, but nothing that locks up the application. This is data paging
> in action, which is just one way of optimizing the data transfer and server
> load.
>
> I think BlazeDS and Flex are a great combination, especially if you're
> sending a big chunk of data because the compact size of the AMF protocol and
> the native serialization you get on the client just make the application
> very responsive, and the automatic type serialization made it quicker to
> implement and less brittle and error prone than making my own xml
> serialization scheme.
>
> Finally, I suggest you check out Tom Jordahl's excellent presentation on
> BlazeDS. It's not technical, but it gives you a good, highlevel overview of
> what it is and its advantages: http://my.adobe.acrobat.com/p56945801/
>
> Best of luck.
>
> /r
> http://www.searchcoders.com/
>
>
>
>
>
>
> On Tue, Apr 29, 2008 at 7:43 AM, netdeep <[EMAIL PROTECTED]> wrote:
>
> >
> > I've been working for quite a while on a project to display real-time data
> > in a flex chart and
> > just can't seem to 'turn the corner' on it. While the code works, it is
> > plagued by terrible
> > performance and frequently locks up the browser. And I'm wondering if I
> > am just doing
> > something wrong or if there are resources available to navigate out of
> > this quagmire.
> >
> > The BlazeDS website claims it enables "Real-time server push over standard
> > HTTP", but what
> > is the expected performance for something like this? How much data can it
> > handle?
> >
> > I realize most charts don't require tons of data points, often needing
> > only 10-100 separate
> > sets of data to display. But for small data sets, why not just use
> > standard HTTP and XML?
> > Why bother with BlazeDS? But in my experience, BlazeDS isn't handling
> > large sets of data
> > very well. I am needing to output scatter plots for scientific data so
> > the data sets can be
> > huge. I've plotted over 140K points in some runs. But even when I filter
> > the data and plot
> > around 10K points, I get browser lockup while it loads and it takes 5-10
> > seconds to produce
> > the chart and lately it has even been crashing on the larger data sets.
> > Is it the conversion
> > from Java objects to Actionscript which is the problem? Am I not using
> > the right channel?
> >
> > I realize this may be too open-ended of a question to get a specific
> > solution, but if anyone
> > knows a book I could buy, or a course available, or a more in-depth forum,
> > please let me
> > know. There just doesn't seem to be much in-depth material available for
> > this functionality
> > right now. And if there are a few standard things to check for when
> > dealing with messaging
> > or just a performant approach to real-time server push in general please
> > share your insights.
> > I am the only developer working with flex at my job and I can tell that
> > people here are
> > skeptical about my choice to make flex the front end for this application.
> > I'm beginning to
> > wonder myself if I have not made the wrong decision. The graphs we
> > produce look great, but
> > in terms of usability, no one would want to use this product in its
> > current state, its way too
> > sluggish and clunky. Sorry this post ended up so long. Thanks for the
> > help the others have
> > offered in the past and if you have any insights into this, I'd sure
> > appreciate hearing from
> > you.
> >
> >
> > ------------------------------------
> >
> > --
> > Flexcoders Mailing List
> > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > Search Archives:
> > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups
> > Links
> >
> >
> >
> >
>