All Examples JMS Examples This Package
package examples.jms.trader
about this package
This example sends a "buy" or "sell" message to a JMS Topic from the Java servlet
TraderServlet.
The TraderReceive client receives the messages and
invokes an EJBean to process the messages.
Configure the server:
-
To use this example, you must build and deploy the
statelessSession EJB example.
- Set up a connection pool as described in the About this package section for the JMS exampels package.
-
Set up the jmstrader servlet by adding this property to
your weblogic.properties file:
weblogic.httpd.register.jmstrader=examples.jms.trader.TraderServlet
-
Set the servlet classpath and reload properties in your weblogic.properties file
by adding the following properties:
weblogic.httpd.servlet.classpath=weblogic/myserver/servletclasses
weblogic.httpd.servlet.reloadCheckSecs=1
where weblogic is the directory where WebLogic is installed.
- Set up the JMS topic and connection factory by adding the following
properties:
weblogic.jms.topic.exampleTopic=javax.jms.exampleTopic
weblogic.jms.connectionFactoryName.trader=jms.connection.traderFactory
weblogic.jms.connectionFactoryArgs.trader=ClientID=traderReceive
Build the example:
-
Set up your development shell, as described in
Setting up
your environment.
-
Compile the servlet file in this directory as shown in this examples for Windows NT:
$ javac -d %SERVLET_CLASSES% TraderServlet.java
-
Compile the client file in this directory as shown in this examples for Windows NT:
$ javac -d %CLIENT_CLASSES% TraderReceive.java
Run the example:
-
Start WebLogic Server in a new command shell.
-
In your development shell, run the client with the following command:
$ java examples.jms.trader.TraderReceive t3://hostname:port
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
-
Load the servlet in a browser with a URL like this:
http://hostname:port/jmstrader
where:
- hostname
- Host name of the WebLogic Server
- port
- Port where the WebLogic Server is listening for connections
(weblogic.system.ListenPort).
-
Enter a trade to send and click the Send button. The
TraderReceive client displays messages as
they are received from the Topic, and displays results from the invoked EJB.
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/13/1999