4.2. A Simple Point-to-Point Example
This section describes the sending and receiving programs in a PTP example that uses the receive method to consume messages synchronously. This section then explains how to compile and run the programs, using the J2EE SDK 1.3.
4.2.1. Writing the PTP Client Programs
The sending program, SimpleQueueSender.java, performs the following steps:
Performs a Java Naming and Directory Interface (JNDI) API lookup of the QueueConnectionFactory and queue
Creates a connection and a session
Creates a QueueSender
Creates a TextMessage
Sends one or more messages to the queue
Sends a control message to indicate the end of the message stream
Closes the connection in a finally block, automatically ...