    All Examples  JMS Examples

# package examples.jms.queue

##

- QueueBrowse
- QueueReceive
- QueueSend

# about this package

This example shows how to establish a connection to a JMS queue and receive messages from a queue. The classes in this package operate on the same JMS queue. Run the classes together to witness messages being sent and received and to browse the queue for messages.

Build the example:

1. Set up your development shell, as described in Setting up your environment.
2. Compile the files in this directory as shown in this examples for Windows NT:

         $ javac -d %CLIENT_CLASSES% *.java

Run the example:

1. Start the WebLogic Server in a new command shell.
2. In your development shell, run the QueueSend client with the following command:

         $ java examples.jms.queue.QueueSend t3://hostname:port

   where:
   hostname
     Host name of the WebLogic Server
   port
     Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).
3. Using the QueueSend client, send messages to the queue.
4. To browse messages in the queue, set up a new development shell, as described in Setting up your environment, and run the QueueBrowse client with the following command:

         $ java examples.jms.queue.QueueBrowse t3://hostname:port

   where:
   hostname
     Host name of the WebLogic Server
   port
     Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).
5. To receive messages from the queue, set up a new development shell, as described in Setting up your environment, and run the QueueReceive client with the following command:

         $ java examples.jms.queue.QueueReceive t3://hostname:port

   where:
   hostname
     Host name of the WebLogic Server
   port
     Port where the WebLogic Server is listening for connections (weblogic.system.ListenPort).
6. To end the program, send a `quit` message from the shell running the QueueSend client.

# there's more...

Read more about WebLogic JMS in the Developers Guide, Using WebLogic JMS.

Copyright © 1997-2000 BEA Systems, Inc. All rights reserved.

Last updated 09/10/1999