CSC 513 Programming Assignment 3: Transformation using Java Message Service
Update
Description
In this assignment you will create a point-to-point (P2P) Java Message Service (JMS)
application, say Producer, to perform the XQuery transforms you wrote earlier in
Programming Assignment 2 and another P2P JMS application, say Consumer to send
XML and receive transformed result. Producer would take the complete csc513news.xml as
input. Producer will recieve the messages containing XML document and return the
resulting transform in a message to the Consumer.
Steps
- Install JBoss application server (JBoss 4 Guide, Getting Started with JBoss 4.0).
- Download jboss-4.0.5.GA.zip and unzip it.
- Run jboss-4.0.5.GA\bin\run.bat or jboss-4.0.5.GA\bin\run.sh to start the server.
- Open the browser and goto http://dns_name or IP:8080 (say, http://127.0.0.1:8080/ or http://localhost:8080/) for the JBoss start page.
- If you don't see it, something is wrong. Check the messages JBoss output on startup for more info.
- Please read through Chapter 33 (JMS part) of
J2EE Tutorial to
understand the fundamentals behind the JMS.
- There is a perfect example in 6.1.1 of
JBoss 4.04 Application Server Guide
(PDF).
- Implement Producer to accept an XML message (a text message containing XML content) as
input, transform the message, and return an XML message (a text message containing
resulting XML content) as output. Perform your transforms using the
Query
in Saxon. Implement your Producer to return the transforms via a queue. (PS: It would be
a good idea to write a standalone Java application to invoke Query, before putting XQuery
transform code in JMS.)
- Write Consumer to pass the XML files (csc513news.xml) as messages to Producer. Test to
ensure this functionality.
- Modify the Consumer to accept and display the transforms returned by the Producer.
When executing JMS application, include all JAR files located in ``jboss/client/'' in your
classpath (and saxon8.jar),
For example, if using Eclipse (recommended),
In Eclipse screenshot:
Project Properties -> Java Build Path -> Libraries -> Add External JARs
and also include the directory containing
jndi.properties in classpath.
In Eclipse screenshot:
Run -> Java Application -> Producer/Consumer -> Classpath -> User Entries -> Advanced -> Add Folders
Please make sure your Consumer and Producer both take one argument, i.e.,:
java -cp %classpath% Producer %XQuery-file%
java -cp %classpath% Consumer %XML-file%
We recommend using JBoss's default queues for message input and output. For example,
use "queue/A" for input to your Producer, and "queue/B" for output from your Producer.
Deliverables
- Package your Producer and Consumer in a JAR archive. Put your
source code, your XQuery from PA2, XSDs from PA2, csc513news.xml, your sample output XML
file, the JAR file, and any extra files, in a ZIP file and submit it.
- Also include a README explaining your architecture and any caveats of implementation
in your zip file.
- No need to include library JAR files and jndi.properties in archive.
Notes
- This is the interaction between components in this assignment:
This is more or less the assignment. Further fine-tuning may be done in the next couple
of days. Be sure to check out this page.