Lab 9 - Java Messaging Services
In this lab you will experiment with Java Messaging Services by setting up applications
that both produce and receive messages. These applications will communicate with
each other using JMS managed by your weblogic server.
-
Resources for this lab:
1. Weblogic's Introduction to JMS
2. Figure 8.3 (page 207) and pages 204-210 in the Mastering Enterprise JavaBeans text.
3. Class 9 lecture notes
-
Setup:
1. Log in to the cspp51024 cluster and open up three separate terminal windows.
2. In each terminal, execute the weblogic environment setup:
. ~/weblogic/weblogic700/samples/server/config/examples/setExamplesEnv.sh
-
Steps:
1. In one of the windows, cd to the ~/weblogic/weblogic700/samples/server/src/examples/jms/drawdemo directory.
2. Read and understand the targets in the build.xml file. Make sure you are using the
proper weblogic server name and port under the 'run' target (the
default for this class is t3://localhost:7001).
3. Examine the file JMSDrawDemo.java, looking for the following:
Method JMS Functionality Provided
----------- ------------------------
1. initJMS Locates/loads drivers, creates/connects to jms session,
creates producer and consumer, starts session.
2. onMessage (consumer role) Reads a message
3. publishPoint (producer role) Publishes a message
4. Run the command: "ant" in the drawdemo directory.
5. Start your weblogic server (in a terminal seperate from the three you created during setup).
6. In each of the three terminals you opened during setup, cd to the
~/weblogic/weblogic700/samples/server/src/examples/jms/drawdemo directory and
run the command 'ant run'.
7. This will start 3 gui applications. Each application has a windows that listens
for mouse events. When a mouse event is registered, a message is published
to the other applications.
8. Experiment with features of each application, specifically JMS transactions.
Assignment: There is no graded assignment this week. By now you should be working on
your final project. If you are stuck, please ask questions to the list or schedule an
appointment with a TA.
ta-51024@cs.uchicago.edu