All Examples JMS Examples This Package
package examples.jms.sessionpool
about this package
This example shows how to establish a pool of server-side message
listeners that process incoming messages in parallel, an optional
feature described in the JMS v1.0.1 specification. The
TopicPool class is a
T3Client application that establishes the
listener pool and then sends messages to a Topic that the pool
has registered to receive. The
QueuePool class is a
T3Client application that establishes the
listener pool and then sends messages to a Queue that the pool
has registered to receive.
The WebLogic Server calls the MsgListener class to process each messages the
pool receives. The MsgListener displays the message in the command shell that
is running the server.
Build the example:
-
Set up your development shell, as described in
Setting up
your environment.
-
Compile the client files in this directory as shown in this examples for Windows NT:
$ javac -d %CLIENT_CLASSES% TopicPool.java QueuePool.java
-
Compile the server-side files in this directory as shown in this example for Windows NT:
$ javac -d %SERVER_CLASSES% MsgListener.java
Run the examples:
-
Start the WebLogic Server in a new command shell.
-
In your development shell, run the
QueuePool client with the following command:
$ java examples.jms.sessionpool.QueuePool t3://hostname:port
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
The server displays messages as they are received from the Queue.
-
To end the program, enter a quit message.
-
In your development shell, run the
TopicPool client with the following command:
$ java examples.jms.sessionpool.TopicPool t3://hostname:port
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
The server displays messages as they are received from the Topic.
-
To end the program, enter a quit message.