Now that you are ready to write your first JMS application because you now know the Message-Oriented Middleware and some JMS concepts. Here we provide a gentle introduction to JMS using the publish-and-subscribe messaging model. You will get your feet wet with JMS and learn some of the basic classes and interfaces.
The JMS Chat Application
Internet chat provides an interesting application for learning about the JMS pub/sub messaging model. This is used mostly for entertainment, web-based chat applications can be found on thousands of web sites(Yahoo's Messenger, Google's GTalk and so on).
In a chat application, people join virtual chat rooms where they can "chat" with a group of other rooms people.
The requirements of Internet chat map neatly onto the publish-and-subscribe messaging model. To illustrate how JMS chat works, we will use the JMS pub/sub API to build a simple chat application.
In this model, a producer can send a message to many consumers by delivering the message to a single topic. A message producer is also called a publisher and a message consumer is also called a subscriber
The source code and description for a JMS-based chat application can be found here:
The Chat Application