JMS MDB Application in ETP Environment with WebsphereMQ and Geronimo.
Note: make sure you completed Configure IBM Websphere MQ Manager Instance and JMS Application in ETP Environment with WebsphereMQ and Geronimo
Target System: Geronimo on Windows
Eclipse IDE with Elastic COBOL
Geronimo Application Server
WebsphereMQ Manager installed on local or remote instance.
This tutorial will describe steps required to configure and deploy an Elastic COBOL application to Geronimo application server. This application will perform a simple MQPUT operation on a queue and will consume that message by a message-driven bean.
We will use existing queue HEIRLOOM.Q.ETP1 to perform MQPUT and another queue HEIRLOOM.Q.ETP2 to attach an MDB to.
Create a COBOL project jmsproject with ETP Transaction nature enabled (e.g. File > New > ETP Project). Place attached MQGETTST.CBL and MQMDBTST.CBL programs into cobol_source directory of the project. Unzip contents of attached copylib.zip file into copylib directory of the project. Place attached ecobol.dir file into resources directory of the project and compile.
- Add heirloomcomputing_mqi.properties file to resouces directory. This properties file is a logical mapping between values that are passed to MQ* routines, and the names for JMS resources in the runtime environment. The two values that need to be set: the ConnectionFactory name (this will be defined in the next steps) and the queue name mapping. Queue name in particular makes it possible to map the name that is used in COBOL code to the actual name defined in the environment (also in later steps this will match the queue name in the ETP deployment properties.)
The below two properties allow additional logging to be enabled/disabled:
Create an ETP Deploy project.
- Add jmsproject as participating project to your ETP project under General Tab.
On the Transaction tab of deployment properties define following transactions
INIT - MQPUTTST
MQPT - MQPUTTST
CVMI - MQMDBTST
On the JMS Tab of deployment properties Add an entries for the JMS Connection Factory, Resource Adapter and MDB Definition/Activation Specifications as shown below.
WMQRA com.ibm.mq 18.104.22.168
- On the Queues Tab define the queue that we will be connecting to. Use the following values. Note that the queue JMS connection drop down will have the value listed as defined in Step 7. Here as on the JMS tab, the local name is the name that this queue will be known to the application, and JNDI name is the name as defined in the deployment descriptor for the MQ connector when it was deployed to the server.
- Deploy the ear file.
Execute the default servlet via http://localhost:8080/dflt/servlet . The below output will display detailed logging about message being put on a queue and the mdb processing it.