Chapter 6. Flex messaging

 

This chapter covers

  • Setting up BlazeDS for messaging
  • Using the Flex Messaging API
  • Creating a polling channel

The Flex Messaging API, bundled with BlazeDS, provides asynchronous messaging, which you can use to create a better user experience by enabling your application to refresh itself in real time whenever anyone using the application makes any changes. The BlazeDS MessageService allows bidirectional communication between Flex clients and the server side.

In general, you want to use messaging to notify the client of changes. This will fire off an event to refresh the FlexBugs issues list. Figure 6.1 demonstrates this use of messaging.

Figure 6.1. Simple polling

This chapter will exploit the use of the Flex Messaging API and simple polling to receive updates from the server when changes in the model have occurred. Changes will cause an event to be dispatched that will refresh the master view and ultimately the list of issues.

The details of messaging operations depend on your needs and the style of underlying messaging architecture you’ve chosen; for example, client-to-client, JMS, Flex to POJO, or JavaBean messaging. On top of that, it’s possible to configure the client to perform simple or long polling or even streaming. All these scenarios for messaging are useful and have accompanying benefits and consequences. It’s always best to start with the simple approach before moving to the complex.

6.1. Setting up BlazeDS for messaging

6.2. Modifying the client for messaging

6.3. Summary