Free since 2005 · No login required
AT

Academic Tutorials

Learn at your own pace

site-mobile-top-banner · 320x50

Building a JMS Client

Added 31 Jul 2008

A typical JMS client can be built following these basic steps:

  1. Create a connection to the messaging system provider
  2. Create sessions, for sending and receiving messages
  3. Create MessageProducers and MessageConsumers to create or receive messages

Once these steps have been performed, a message-producing client will create messages and publish them to topics, while a message-consuming client will listen for messages associated with a topic, and consume them as they arrive.

To illustrate in detail how this works, we examine a typical message producer, used to publish messages to a topic in a pub/sub messaging system. Note that all exception handing code has been omitted for clarity.