O'Reilly logo

Designing and Programming CICS Applications by Members of the CICS Development Team at IBM Hursley, John Horswill

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Coding the Java Application

There are seven steps that are involved in developing this part of the application:

  • Coding the Java application

  • Opening the relevant MQSeries queues

  • Creating the MQSeries message

  • Adding the CICS program name and the COMMAREA fields in the message buffer

  • Sending the request message to the bridge queue in MQSeries for OS/390

  • Receiving the response message

  • Checking for CICS related errors

Coding the Java Application

To provide the connection to an MQSeries queue manager, we have created a Java class MQCommunicator. It looks like this:

public class MQCommunicator {.......}

The full code is on the accompanying CD in the directory called \mqseries-java client\MQCommunicator.class.

MQSeries provides a number of Java classes, which we can access on Windows NT by importing the package com.ibm.mq.*. In order to make a connection to the relevant queue manager we need to supply the following information:

  • The IP address of the host machine on which the OS/390 queue manager that we are going to use is located

  • The name of the Windows NT queue manager

  • The name of the MQI channel that makes the connection from the MQSeries client to the Windows NT queue manager (named in the previous bullet)

  • The request queue where we put the MQSeries message containing details of the customer account number

  • The reply-to queue onto which we get the response message containing the customer details supplied by the NACT02 application

The code looks like this:

// Setup MQ object MQComms=newMQCommunictaor(hostname,qManager,channel,requestQueue,replyQueue); ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required