In this assignment, we will continue with our work in P1 and P3, extend our Project Zero timeslot signup system to interact with JMS message queues.
In our timeslot signup system, after signing up the timeslots, users may export their selections in an XML format (chang2.xsd). However, the signup system can only export to its XML format (chang.xsd). Our goal is to enable the timeslot signup system send the exported XMLs as messages to a queue (realized using the Java Messaging Service). A standalone Java application that listens to the queue transforms the message using XQuery from chang.xsd to chang2.xsd, and sends the results to another queue. The timeslot signup system retrieves the results from the queue, and shows them to the user.
The architecture of this assignment is shown above. We have to implement the green box and the yellow box. The green box is the extension of the timeslot signup system as in P1. Besides the original functionalities developed in P1, the system should be capable of (1) retrieving all occupied timeslots from the database and exporting them to the XML format (chang.xsd), (2) sending the exported XML document as a text message to a queue, and (3) retrieving the transformation resulting XML document (chang2.xsd) from another queue. For concreteness, we will use the builtin JBoss queues with names A and B, respectively.
The yellow box is a Java standalone application Saxon XQuery transformer that (1) listens to the JMS queue A, (2) transforms the message using XQuery as in P3, and (3) sends the results to JMS queue B.
We use JBoss as our JMS message queue provider. We use JBoss default message queues: queue/A as our JMS message queue for input; queue/B as our JMS message queue for output.
jboss-4.2.1.GA\bin\run
The Saxon XQuery Transformer should take the XQuery file as input. All libraries (JMS, Saxon) and config files required for JMS functionalities are here. Please include this file in the classpath. For example, to compile and execute the transformer.
javac -classpath lib.jar Transformer.java java -cp lib.jar Transformer chang.xq
Here is the document of how to invoke XQuery transformation using Saxon in Java.