O'Reilly logo

Distributed Computing in Java 9 by Raja Malleswara Rao Pattamsetti

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Developing a JMS application

A Java program with JMS needs to execute the following steps to be able to produce and consume messages in either publish/subscribe or Point-To-Point:

  1. Look up a ConnectionFactory object through the Java Naming and Directory Interface (JNDI).
  2. Look up one or more Destination objects through the JNDI.
  3. With the reference of the ConnectionFactory object, create a Connection object.
  4. With the help of the Connection object, create one or more Session objects.
  5. With the help of the Session and Destination objects, create the required MessageProducer and MessageConsumer objects.
  6. Start Connection.

Once you execute the preceding steps, the program will be able to exchange the messages and receive, process, and send messages ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required