Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Initial Phase
Wiki Markup
{scrollbar}

AnchortoptopEnterprise messaging has become an increasingly important component of loosely coupled, reliable enterprise frameworks. This is due in large part to the proliferation of enterprise applications and disparate enterprise resources, and the increasing need to integrate these applications into cohesive systems. Over the years Messaging and Message Oriented Middleware (MOM) has provided this integration propritery way. Introduction of Java Messaging Service (JMS) standard has eliminated many of the disadvantages in propritery MOM based products. In addition to that Message Driven Beans (MDBs) introduced with Enterprise Java Beans 2.0 have served to get the best out of existing investments in J2EE application servers. Most of the J2EE application servers in modern era are acting as a MOM with a whole lot of value added services to JMS. Apache Geronimo comes in to the party with support of JMS integrating one of the best breed open source messaging frameworks ActiveMQ. This article will guide you a way to use JMS/MDBs for in enterprise application scenario in both as a locally and remotely reffered enviroments with Geronimo and ActiveMQ.

...

After decompressing the given file, the Order directory is will be created.

Configuring

Configuration of the application consists of creating the database and defining the connection pool to access itJMS resources and accessing them via defferent sorts of enviroments.

Creating JMS Specific Resources

Modify Property Files

Note

This build script depends on XDoclet version 1.2.3 and Geronimo 1.1.

Building

Deploying

Back to Top

...

All JMS specific resource information can be found in the config/jms-resource-plan.xml file. Please follow given to deployment after logged in to the Geronimo console.

  1. Select Deploy New link from the Console Navigation in the left.
  2. Load the <geronimo_home>/repository/geronimo/ge-activemq-rar/1.1/ge-activemq-rar-1.1.rar file to the Archive field.
  3. Load the Order/config/jms-resource-plan.xml file to the Plan input field.
  4. Press Install button. Make sure Start app after install is selected when this deployment happens
  5. After you get the successful installation message, verify the deployment traversing JMS resources link. It will display the connection factory and two JMS queues.

Modify Property Files

This application has two different property files in the config folder namely build.properties and order_mgmt.properties. Build process of the application is entirely depends on the build.propeties while application will use order_mgmt.properties to load application related properties.

Set the correct paths to the xdoclet.home and geronimo.home directories to work application build process correctly.

Note

This build script depends on XDoclet version 1.2.3 and Geronimo 1.1.

order_mgmt.properties file given is shared among four defferent application components. If you deploy one of these application components out side of application server, make sure to change the relevant network property in the above mentioned property file.

Building

Use a command prompt to navigate into the Order directory and just give ant command to build. It will create the Order.ear, recvclient.jar and sendclient.jar under the Order/releases folder. Also note it will create a lib folder and copy list of jar files refered by the remote client applications. Now you are ready to deploy order processing application in to the Geronimo Application server.

Deploying

Deploying Order processing sample application is pretty same as the deployment of JMS resources.

  1. Travel Deploy New from the Console Navigation.
  2. Load Order.ear from Order/releases folder in to the Archive input box.
  3. Press Install button to deploy application in the server.

Back to Top

Testing of the Sample Application
Anchor
testing
testing

Core business functionality of the order processing application is shared among the three different client applications.

Order Placement Web Application

To test the sample web application open a browser and type http://localhost:8080/OrderImage Added. It will forward you in to the Order Management Welcome page. Then user has to fill the necessary information for the order placement and submit it.

Image Added

Consignment Placement Remote Application

This application will send consignment requests to the consignment queue. It will take consignment file as a command line argument. Sample consignment has been given with the appication archive as Order/config/sample-consignment.xml. First travel to the Order/releases from a command prompt and give the following command.

java -jar sendclient.jar <home>/Order/config/sample-consignment.xml

Image Added

Consignment Listener Remote Application

Listener application to the consignment queue. It will download the consignment requests in the local repository. As in the above mentioned application first travel to the Order/releases from a command prompt. After that issue following command to start listening on the consignment queue.

java -jar recvclient.jar

Note

Always consider lib folder inside of releases are a part of this client application.Check your Operating Sytem's security configuration when you are connecting from a remote machine.

Summary
Anchor
summary
summary

This article has demontrated how to use JMS features in Apache Geronimo with the ActiveMQ JMS server.It provides a hypothical example which extensively used JMS features to application processing.

Following are some of the highlights.

  • Apache Geronimo is a J2EE 1.4 Certified application server and it provides all the necessary features support asynchronous mode of communication.
  • Define JMS connection factories and related queues.
  • Message Driven Beans are the components are listener application components provides by J2EE container. This article has shown how to define them effective manner.
  • Sending and recieving data to a defined queue as a remote client to the application server

...

Order Placement Web Application

Image Removed

Order Placement Remote Application

Image Removed

Note

Always consider lib folder inside of releases are a part of this client application.Check your Operating Sytem's security configuration when you are connecting from a remote machine.

...