You are now in a position to start coding. For all the following code examples, you will need to import the javax.jms package. This contains all the classes for creating connections, sessions, queues, and topics.
To send a JMS message, a number of steps must first be performed to obtain a connection factory, establish a session, and create a QueueSender object. Although the example is in the point-to-point message domain, the same steps are required for publish/subscribe topics.
The following steps show how to create a queue used later to send a simple text message.
Obtain the JNDI initial context.
Context context = new InitialContext();
Contact the JMS provider, obtain a JMS connection from the appropriate ...