Java
Flex: A Simple Chat in Fewer Than 20 Lines
One of Adobe Flex’s notable features was how easily it could use messaging services. On the client, the <mx:Producer /> and <mx:Consumer /> components abstracted much of the communication with a back-end data service.
In the Java ecosystem, common choices included LiveCycle Data Services and the open source BlazeDS. This example used Java with BlazeDS to create a chat whose Flex interface contained fewer than 20 lines of code—not counting server configuration.
Original example structure
- Configure a streaming channel, or an AMF channel with polling, in
services-config.xml. - Create a
destinationnamedchatMessageinmessaging-config.xml. - Register the messaging configuration in BlazeDS.
- Build the interface with a
Producerto send messages and aConsumerto receive them. - Start the web server and open the chat in two different browsers or sessions.
Partially unavailable code: both the WordPress export and the current public page contain empty configuration and MXML blocks. Because the missing content could not be verified, I did not reconstruct or invent it.

What did this article spark?
Choose more than one and undo at any time.
Comments
Loading comments…