|Home > Documentation > Apache Geronimo v1.0 - User's Guide > Integrating A Third Party JMS Provider|
Apache Geronimo is bundled with an open source messaging provider called Active MQ. ActiveMQ supports JMS API and J2EE applications deployed in Geronimo can use the messaging capabilities of ActiveMQ by means of JMS. In the following article you will learn how to configure another third party messaging provider that supports JMS specification with Geronimo. The article includes two sample scenarios using OpenJMS, another open source messaging provider, and IBM WebSphere MQ as messaging provider.
Websphere MQ 6.0
Any third party JMS provider can be integrated with Geronimo by means of a JCA 1.5 resource adapter for JMS. The JMS RA wraps JMS API for creating connections to Queue's or Topic's and also provides Inbound Communication from a Queue or Topic.
The properties for the Resource Adapter are configured in the ra.xml. These properties are:
The geronimo-ra.xml contains Apache Geronimo specific properties for resource adapter. The following example shows an excerpt from the geronimo-ra.xml.
geronimo-ra.xml can be used to configure instances of resource adapters for different JMS providers. The example at the end of this article has two such configurations for OpenJMS and WebsphereMQ. The connection definition properties are changed for different JMS providers. The outbound communication of Resource Adapter uses these properties to get a connection factory and create connections to Queue or Topic.
This section shows how to deploy a JMS Resource Adapter and configure a J2EE application to use OpenJMS and WebSphereMQ as JMS providers. RA can be deployed in the server scope and instances can be used within scope of application.
The following steps show how to deploy the JMS Resource Adapter and configure OpenJMS and WebSphereMQ providers for Geronimo.
OpenJMS starts RMI naming server on port 1019. This will conflict with the default RMI naming port in Geronimo. You will have to change the configuration for OpenJMS to use a different port and then start the OpenJMS server. Create QueueConnectionFactory and TopicConnectionFactory objects for OpenJMS. Define Queue's and Topics in openjms.xml. The following example shows relevant sections of the configuration file.
Deploy a JMS Resource Adapter with server scope.
java -jar <geronimo_home>\bin\deployer.jar <sample_home>\externaljms-1.0.rar
Deploy an enterprise application that uses OpenJMS.
java -jar <geronimo_home>\bin\deployer.jar <sample_home>\externaljms.ear <sample_home>\geronimo-application-openjms.xml
|externaljms-1.0.rar, externaljms.ear and geronimo-application-openjms.xml are available for download in the Attachments section. You may want to download these files into a <sample_home> directory.|
The following example shows sections of Geronimo application plan for using OpenJMS. The properties for Outbound and Inbound communication are specified in the Message Bean and the Connector.
The properties configured in the geronimo-application.xml plan are:
Resource Adapter Instance
The following steps describe how you need to configure WebSphereMQ.
The RA for JMS does not support XA. This can be added to make WebsphereMQ or OpenJMS part of distributed transactions in Geronimo.
There is a sample GenericJMS RA with XA support available in Sun java.net. This RA can be deployed in Geronimo to get XA support for JMS Providers. Visit the following link for further details, http://genericjmsra.dev.java.net
Resource Adapter - RA
WebsphereMQ - WMQ
Message Driven Bean - MDB
externaljms.ear - EAR application and Source Code that contains WAR for Outbound and MDB for Inbound from RA
externaljms-1.0.rar - JMS Rresource adapter and Source Code.
geronimo-application-mq.xml - Geronimo plan for MQ.
geronimo-application-openjms.xml - Geronimo plan for OpenJMS.