6.5. The Chat Window

Although the chat window in the example application is part of the entire system, it's actually logically isolated from the market data updating functionality for the most part. You can chat with your investment advisor about the moving prices and that is where the unity exists from a user interaction perspective, but apart from that, the common elements are limited. You can develop the chat application independently of the part that relies on JMS messaging. Let's see how.

The messaging infrastructure in BlazeDS can be utilized for message-based communication between two Flex clients. Messages are routed between the two participating clients via the server. That is, a Flex client sends a message down to a server-side messaging destination via a channel and an endpoint pair. Another Flex client listens for messages at this destination. When a destination receives a message, all subscribers to that destination receive the message.

JMS and the JMSAdapter are not required in this entire interaction. Instead, an ActionScriptAdapter facilitates the communication between the Flex clients. In the next section, you will delve more deeply into these adapters and also learn how to create a custom messaging adapter.

The messaging infrastructure with ActionScriptAdapter supports a publish/subscribe messaging domain. That is, message producers and consumers are coupled together on the basis of an intermediary, which in this case is a topic. This implies that messages sent ...

Get Professional BlazeDS: Creating Rich Internet Applications with Flex® and Java® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.