Description | JBoss | JMS | | Deliverable
| Resources
4/4/2009 Please check here for how to get the Java example for JBoss 4.2.1 running.
3/31/2009 Added instructions for accessing Campus Oracle DB Server.
3/31/2009 Changed the project requirement a bit. You will need to write a xquery script to process the incoming xml message as indicated in task (2).
Consider the scenario below.
An E-Commerce website, like the simple website we built for Project 1, sends the book orders in an XML format (assume all books order XML files conform to this schema) to a Message Queue for backend processing. The Message Queue keeps the messages received from the E-Commerce website. A backend java program reads an incoming order from the Message Queue, parses its contents, and based on a query to its database, decides where to forward the order.
You will need to write the backend Java program to do the following tasks:
(1) Read xml message (book orders) from Message Queue
(2) Run a simple .xq script against the incoming order to get book ids. You can write the .xq as you want, but you will need to run it programmatically in the java program.
(3) Query the stock database to check if all the books in the order exist in the stock
(4) If all the books in the book order has copy in stock, print TYPE A message, like, “All BOOKS IN THE ORDER ARE IN STOCK”
(5) If not, print TYPE B message, for example, “SOME BOOKS IN THE ORDER ARE NOT IN STOCK”
Must Read:
* You will need to install JBoss for the message queue, see instructions below.
* There is a good tutorial regarding how java program communicate with message queue JBoss 4.04 Application Server Guide
* At first, the JBoss message queue is empty; you can use your java program to send a book order (for example, book-order) to the message queue (simulating the E-Commerce website order submission). Then the Message queue has some message, your java program can retrieve the message and do other tasks.
* Assume all book order XML files conform to this schema.
* You will need to set up the stock database using on Campus Oracle server (instructions). The DB content should be initialized to the content below. (here is a script for your convenience)
book-id |
num_of_copies |
1 |
10 |
2 |
10 |
3 |
10 |
4 |
10 |
5 |
10 |
6 |
10 |
7 |
10 |
Instructions can be found at http://www.csc.ncsu.edu/techsupport/technotes/oracle.php
Accessing campus Oracle DB
server instructions can be found here.
Here are the instructions to
setup JBoss.
jboss-4.2.1.GA\bin\run
Last Update: March 27, 2009
Xibin Gao (xgao2@ncsu.edu)