Intro OpenMQ is one of the subprojects of GlassFish and servers as both the JMS reference implementation as well as a production-quality implementation fully integrated with GlassFish. It is also usable in standalone mode (check the Message Queue 4.5 Technical Overview for details). This page contains material from the GlassFish MQ bootcamp to get your feet wet and hands on the technology. It covers the following topics :
- OpenMQ basics
- Compile simple java applications to send and receive messages via the JMS API
- Compile and package a simple MDB application which receives a message from a JMS destination and sends a message to another JMS destination
- How to configure a GlassFish instance
- How to configure a GlassFish cluster
Raw material is available from this link. If you have questions about OpenMQ, GlassFish or this material, please consider using the GlassFish Forum or USERS mailing list. JMS Bootcamp slides (click to open PDF)  JMS Bootcamp hands-on-lab
- List of commands to be used for both labs (you can follow these, or read the instructions following)
Setup
- Install GlassFish Server. Download latest GlassFish 3.x bundle from http://glassfish.java.net/public/downloadsindex.htm.
- Compile the applications and place the binaries in the test directory OR Download the above mentioned test bundle, "test.zip" and unzip it in the test directory
Link to the Applications used in the Demo
- Message-Driven Bean : GenericMDB.java
- JMS Sender : Sender.java
- JMS Receiver : Receiver.java
- test.zip : test.zip Archive Containing the Source Code and Binary for the MDB and the JMS Clients. Use the test.zip if you don't want to compile the applications yourself.
Instructions to Compile the Applications
- set CLASSPATH to $GLASSFISH_HOME/lib/javaee.jar:$MQ_HOME/lib/imq.jar:$MQ_HOME/lib/jms.jar:.
Compile MDB
- javac GenericMDB.java
- jar cvf ejb-jar-ic.jar GenericMDB.class
- jar cvf simplemdb.ear ejb-jar-ic.jar
Compile JMS Sender/Receiver
- javac Sender.java Receiver.java
- Copy the simplemdb.ear, Sender.class and Receiver.class to the test directory.
Instructions for Running the Demo In class labs
Labs for later
|