Follow

JMS Application in ETP Environment with WebsphereMQ and Geronimo.

JMS Application in ETP Environment with WebsphereMQ and Geronimo.

 

 Note: make sure you completed Configure IBM Websphere MQ Manager Instance

Target System: Geronimo on Windows

 

Software Required

  • 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 MQPUT and MQGET operations on a queue. 

 

  1. We will use existing queue HEIRLOOM.Q.ETP1 to perform MQPUT and MQGET operations.
  2. In an existing Geronimo server deploy the MQ resource adapter supplied by IBM. A deployment descriptor has to be provided. This is where you define the endpoints for the remote WSMQ server, Connection Factories and Queue/Topic definitions.

    The default resource connector is supplied with WSMQ client installation and can be found under [Websphere Installation Directory]\java\lib\jca\wmq.jmsra.rar

    Pre-configured resource adapter with packaged geronimo deployment descriptor is attached below:
    wmq.jmsra.heirloom.rar

    geronimo-ra.xml
    deployment descriptor is attached below.  Edit that xml file and specify the server name where WebsphereMQ Manager is installed inside parameter "hostName".  Then package the modified xml file inside the above mentioned wmq.jmsra.heirloom.rar archive in wmq.jmsra.heirloom.rar\META-INF\ directory before deployment.

 

 

  1. Create a COBOL project jmsproject with ETP Transaction nature enabled. Add a COBOL program that performs MQ operations (e.g. File > New > ETP Project).  Place attached MQGETTST.CBL and MQPUTTST.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.

  2. 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.)




     com.heirloomcomputing.ecs.mqi.jms.ConnectionFactory=HeirloomMqConnectionFactory
     com.heirloomcomputing.ecs.mqi.jms.Destination.HEIRLOOM.Q.ETP1=HEIRLOOM_Q_ETP1

   

     The below two properties allow additional logging to be enabled/disabled:


     com.heirloomcomputing.ecs.mqi.jms.JMSModule.trace=true
     com.heirloomcomputing.ecs.mqi.api.MQIConnectionManager.trace=true

 

 

  1. Create an ETP Deploy project.

  1. Add jmsproject as participating project to your ETP project under General Tab.

     

     

  2. On the Transaction tab of deployment properties define following transactions
    INIT - MQPUTTST
    MQGT - MQGETTST
    MQPT - MQPUTTST

     

     

  3. On the JMS Tab of deployment properties Add an entries for the JMS Connection Factory and Resource Adapter as shown below.  (Note: a MDB Definition/Activation Specifications are only needed when creating MDB's as described in another post):

    jms/HeirloomMqConnectionFactory
    WMQRA  com.ibm.mq   7.1.0.0

     

     

     

  4. 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 9. 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.

     

  5. Deploy the ear file.

     

  6. Execute following url's/transactions to test MQPUT and MQGET. 
    http://localhost:8090/dflt/servlet?transid=mqpt&commarea=test1


    http://localhost:8090/dflt/servlet?transid=mqgt



  7. The below output will display detailed logging about connecting and browsing the queue.

 

 

References: WSMQ client from IBM (link). 

Pre-configured WSMQ connector: download

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.
Powered by Zendesk