    All Examples  JMS Examples  This Package

# package examples.jms.trader

##

- TraderReceive
- TraderServlet

# 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:

1. To use this example, you must build and deploy the statelessSession EJB example.
2. Set up a connection pool as described in the About this package section for the JMS exampels package.
3. Set up the jmstrader servlet by adding this property to your `weblogic.properties` file:

         weblogic.httpd.register.jmstrader=examples.jms.trader.TraderServlet

4. 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.
5. 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:

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

         $ javac -d %SERVLET_CLASSES% TraderServlet.java

3. Compile the client file in this directory as shown in this examples for Windows NT:

         $ javac -d %CLIENT_CLASSES% TraderReceive.java

Run the example:

1. Start WebLogic Server in a new command shell.
2. 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).
3. 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).
4. 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