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

  1. Install JBoss application server (JBoss 4 Guide, Getting Started with JBoss 4.0).
    1. Download jboss-4.0.5.GA.zip and unzip it.
    2. Run jboss-4.0.5.GA\bin\run.bat or jboss-4.0.5.GA\bin\run.sh to start the server.
    3. 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.
    4. If you don't see it, something is wrong. Check the messages JBoss output on startup for more info.
  2. Please read through Chapter 33 (JMS part) of J2EE Tutorial to understand the fundamentals behind the JMS.
  3. There is a perfect example in 6.1.1 of JBoss 4.04 Application Server Guide (PDF).
  4. 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.)
  5. Write Consumer to pass the XML files (csc513news.xml) as messages to Producer. Test to ensure this functionality.
  6. 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

Notes

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.