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

Point-To-Point (queue) programming

As discussed in the previous section, interfaces that extend the core JMS interfaces of Queue help build Point-To-Point components.

Please remember that to be able to execute the following example programs, you need the message queue to have been set up.

The following is a sample program to send messages to the Point-To-Point Queue:

package pointtopoint;import java.io.BufferedReader;import java.io.InputStreamReader;import javax.jms.Queue;import javax.jms.QueueConnection;import javax.jms.QueueConnectionFactory;import javax.jms.QueueSender;import javax.jms.QueueSession;import javax.jms.Session;import javax.jms.TextMessage;import javax.naming.InitialContext;/*** Program to send messages to the queue* @author ...

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