ConnectInternetwith MQ VisAgeJava Sg242144
ConnectInternetwith MQ VisAgeJava Sg242144
December 1997
SG24-2144-00
December 1997
IBML
Take Note!
Before using this information and the product it supports, be sure to read the general information
in Appendix C, “Special Notices” on page 205.
When you send information to IBM, you grant IBM a non-exclusive right to use or distribute the
information in any way it believes appropriate without incurring any obligation to you.
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix
Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
The Team That Wrote This Redbook . . . . . . . . . . . . . . . . . . . . . . xv
Comments Welcome . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
Chapter 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 About MQSeries Version 5 . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 About MQSeries and Java . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 About VisualAge for Java . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 About This Book′s Objectives . . . . . . . . . . . . . . . . . . . . . . . 5
1.5 About Internet Connections . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5.1 MQSeries Internet Gateway . . . . . . . . . . . . . . . . . . . . . . 7
1.5.2 MQSeries Client for Java . . . . . . . . . . . . . . . . . . . . . . . 8
1.5.3 MQSeries Bindings for Java . . . . . . . . . . . . . . . . . . . . . . 9
1.6 About Connections to the Mainframe . . . . . . . . . . . . . . . . . . . 9
1.7 About Internet Applications . . . . . . . . . . . . . . . . . . . . . . . . . 11
Chapter 2. Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.1 IBM Internet Connection Secure Server . . . . . . . . . . . . . . . . . 14
2.1.1 How to Get the ICSS . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.1.2 Hardware and Software Requirements . . . . . . . . . . . . . . . 14
2.1.3 How to Install the ICSS on a Windows NT System . . . . . . . . . 17
2.2 Netscape Navigator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2.1 How to Get the Browser . . . . . . . . . . . . . . . . . . . . . . . . 24
2.2.2 How to Install the Browser . . . . . . . . . . . . . . . . . . . . . . 24
2.2.3 How to Set Up the Browser for Java . . . . . . . . . . . . . . . . . 25
2.3 Java Development Kit (JDK) 1.1.4 from Sun . . . . . . . . . . . . . . . 26
2.3.1 How to Download the JDK 1.1.4 . . . . . . . . . . . . . . . . . . . . 27
2.3.2 How to Install JDK 1.1.4 . . . . . . . . . . . . . . . . . . . . . . . . 28
2.4 MQSeries Version 5.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.4.1 About MQSeries Version 5.0 . . . . . . . . . . . . . . . . . . . . . 29
2.4.2 About the MQSeries Client for Java . . . . . . . . . . . . . . . . . 31
2.4.3 How to Install MQSeries Version 5 . . . . . . . . . . . . . . . . . . 31
2.5 MQSeries Client for Java . . . . . . . . . . . . . . . . . . . . . . . . . . 33
2.5.1 How to Get the MQSeries Client for Java . . . . . . . . . . . . . . 33
2.5.2 Installing the Documentation . . . . . . . . . . . . . . . . . . . . . 34
2.5.3 Installing the MQSeries Client for Java . . . . . . . . . . . . . . . 35
2.5.4 Running the Installation Verification Applet . . . . . . . . . . . . 37
Contents v
7.2 Benefits of OTMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
7.3 The IMS Bridge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
7.4 How to Set Up the IMS Bridge . . . . . . . . . . . . . . . . . . . . . . 153
7.5 The IMS Bridge and the Application . . . . . . . . . . . . . . . . . . 156
7.6 Some Tips about Data Conversion . . . . . . . . . . . . . . . . . . . 158
7.7 Some Hints for Implementation . . . . . . . . . . . . . . . . . . . . . 160
Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Contents vii
viii Connecting to the Internet with MQSeries and VisualAge for Java
Figures
Figures xi
xii Connecting to the Internet with MQSeries and VisualAge for Java
Tables
1. ICSS Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2. ICSS Configuration Parameters . . . . . . . . . . . . . . . . . . . . . 20
3. MQSeries Objects for MQM-to-MQM Connection . . . . . . . . . . . 59
4. Start MQM-to-MQM Connection . . . . . . . . . . . . . . . . . . . . . 60
5. MQSeries Definitions to Start Channels . . . . . . . . . . . . . . . . . 61
6. Method connectToQmgr and Parameters . . . . . . . . . . . . . . . 129
7. Method disconnectFromQmgr and Parameters . . . . . . . . . . . 131
8. Method openQueue and Parameters . . . . . . . . . . . . . . . . . 132
9. Method closeQueue and Parameters . . . . . . . . . . . . . . . . . 133
10. Method putMessage and Parameters . . . . . . . . . . . . . . . . . 135
11. Method retrieveMessage and Parameters . . . . . . . . . . . . . . 138
12. Message Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
13. WWW/IMS Example - Methods . . . . . . . . . . . . . . . . . . . . . 173
14. WWW/IMS Example - Method connectToQmgr and Parameters . 174
15. WWW-IMS Example - Method openInputQueue and Parameters . 176
16. WWW-IMS Example - Method openOutputQueue and Parameters 176
17. WWW-IMS Example - Method formatToIMSmessage and
Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
18. WWW-IMS Example - Method putMessage and Parameters . . . . 179
19. WWW-IMS Example - Method retrieveMessage and Parameters . 181
20. Files on Diskette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
This book describes how to develop programs that use MQSeries with
VisualAge for Java. It contains examples that help you write your first Java
applet and Java application, with and without VisualAge. Another example
explains, in detail, how to invoke MQSeries APIs. The final example shows
how a Java applet connects to an IMS application via a Java application
running in the Web server.
VisualAge for Java is the newest member of the IBM VisualAge family. This
development tool helps you to build Java-compatible applications, applets
and JavaBean components. This redbook demonstrates how easy it is to
build graphical user interfaces and internet programs using this powerful
product.
With MQSeries Version 5, IBM delivers the MQSeries bindings for Java.
This software enables you to write Java server applications that use
MQSeries for messaging. This book includes examples on how server
programs make use of the bindings to communicate with clients, other
server programs and the host.
Sam Delmer is a systems integrator for IBM Global Services - South and an
MQSeries Certified Specialist. He specializes in bridging SAP to legacy
systems using MQSeries and data interfacing tools. Sam has experience
programming with C, Java, Visual Basic, and Perl and has a background in
UNIX administration. He is currently working on MQSeries design,
development, and implementation for the IBM PCCo SAP project. Sam is
originally from San Antonio, Texas and holds a bachelor′s degree from
Vanderbilt University.
xvi Connecting to the Internet with MQSeries and VisualAge for Java
written on performance issues, application development for the banking
industry, and about MQSeries.
Linda Robinson
Shawn Walsh
Systems Management and Networking ITSO Center, Raleigh
Grainne Maher
Peter Niblett
Stephen Todd
IBM Hursley, England
Pierangelo Giusta
IBM Italy
Comments Welcome
Your comments are important to us!
Preface xvii
xviii Connecting to the Internet with MQSeries and VisualAge for Java
Chapter 1. Introduction
The project to write this redbook included the newest technology available,
such as MQSeries for Windows Version 5, the MQSeries Client for Java, the
MQSeries Bindings for Java, and VisualAge for Java. The purpose was to
explain how to use these products and to develop some small applications
that use MQSeries over the Internet. The programming language for both
client and server programs was Java. The platform was Windows NT. This
redbook documents the effort of this project. It helps application designers
and developers to get started writing programs with MQSeries and Java.
The programs written for this projects have been tested and perform all
functions required. However, the code is not intended to be state of the art.
The programs are included on a diskette supplied with this book.
There are several feature areas for this new release. MQSeries customers
will be pleased to see that many important ″wish list″ features have been
included. These will enable application and system designers to extend
their use of MQSeries to new and additional types of distributed
applications.
1. Major new functions:
• Database-message resource coordination
• Smart distribution for multicast messages
• Performance boosts for distributed messaging
2. Customer requirements addressed:
If your enterprise fits any of the following scenarios, you can gain significant
advantages by using MQSeries Client for Java:
• A medium or large enterprise that is introducing intranet-based
client/server solutions. Here Internet technology provides low-cost easy
access to global communications, while MQ connectivity provides high
integrity with assured delivery and time independence.
• A medium or large enterprise with a need for reliable
business-to-business communications with partner enterprises. Here
again, the Internet provides low-cost easy access to global
communications, while MQ connectivity provides high integrity with
assured delivery and time independence.
• A medium or large enterprise that wishes to provide access from the
public Internet to some of their enterprise applications. Here the
Internet provides global reach at a low cost, while MQ connectivity
provides high integrity through the queuing paradigm. In addition to low
cost, the business can achieve improved customer satisfaction through
24 hour a day availability, fast response, and improved accuracy.
Chapter 1. Introduction 3
• An Internet Service provider, or other Value Added Network provider,
such as EDI brokers. These companies can exploit the low cost and
easy communications provided by the Internet and add the value of high
integrity provided by MQ connectivity. An Internet Service provider who
exploits MQ can immediately acknowledge receipt of input data from a
Web browser, guarantee delivery, and provide an easy way for the user
of the Web browser to monitor the status of the message.
VisualAge for Java is the newest member of IBM′s VisualAge family. Its
creation is a clear example of IBM′s total commitment to Java technology
and its continued development. VisualAge for Java is a powerful suite of
application development tools that allows you to build complete 100% Pure
Java applications, applets and JavaBeans by using the award-winning
VisualAge ″Construction from Parts″ paradigm.
VisualAge for Java simplifies your Java development process in four major
ways:
1. Client/server programming in Java is made easier through automatic
generation of JavaBean components and middleware code that connects
the Java client to existing transaction, data and application servers.
2. An intelligent development environment enables your enterprise to build
scalable Java solutions that run on Windows 95, Windows NT, OS/2, AIX,
OS/400, and OS/390.
We decided to use VisualAge for Java to develop some client and server
programs. Consequently, we explain for new users how to get started with
this technology. Some advanced Java applets and applications show how to
use the MQSeries Client for Java and the MQSeries Bindings for Java.
Programmers who have written MQSeries programs in C or any other
language will have no difficulties using the new Java classes for MQSeries.
Chapter 1. Introduction 5
The examples are on the diskette supplied with this book.
There are several ways to connect a client to a server via the Internet or
intranet and use MQSeries for messaging.
The gateway acts as a mediator between the HTTP server and MQSeries. It
receives data from the HTTP server and packages it into an MQSeries
message. It then waits for the MQSeries reply message and passes it back
to the HTTP server.
Chapter 1. Introduction 7
submit to the server. The Web server is configured to recognize the type of
the data sent by the client and will activate the MQSeries Internet Gateway
programs and pass the data in the form of name value pairs using one of
the defined interfaces, such as the CGI.
The gateway will receive this data and create an MQSeries message and
put it into an MQSeries queue. The names of the queue manager and
queue will be supplied by the HTML form.
A Web-aware MQSeries application will read the queue, get the message,
generate a reply in HTML format and then put it into the reply-to queue.
The gateway reads this queue, gets the message, and passes it to the Web
server, which then sends it to the browser.
Later in this book, we describe some MQSeries server programs that use
the bindings.
In our case, we send messages to an IMS program via the IMS Bridge, an
MQSeries application. We do not need a server program to do this,
however, we choose to. Since the queue manager in the Web server
machine manages all messages from the clients, it may put them either in a
local queue for processing by a server program, or in a transmission queue
destined for the IMS.
Figure 5 on page 10 illustrates the two possibilities. The first message from
the applet for IMS is processed by a program in the server machine (it is
logged to a disk). The second one is put in a transmission queue; and the
queue manager forwards it to the mainframe.
Chapter 1. Introduction 9
Figure 4. Global View of Installed Systems
Today, about 50 million users in about 160 countries are connected with
more than 50,000 networks. By the turn of the century, we may see over 500
million users connected with a million networks generating a billion dollars
worth of transactions or more.
Demonstration
An order entry application featuring clients connecting to a server
program is desribed in the redbook Internet Application Development
with MQSeries and Java , SG24-4896. The demonstration is available on
the intranet.
Chapter 1. Introduction 11
12 Connecting to the Internet with MQSeries and VisualAge for Java
Chapter 2. Installation
For other operating systems, you have to follow the specific instructions for
that operating system.
From here select the Internet Connection Secure Server (Version 4.2.1) for
your operating system and follow the instructions as they appear. You have
to register yourself and then, again, select the file you want to download
from a combo box, such as:
ICSS for Windows NT 4.2.1.3 - US English
For SNMP support, install the SystemView Agent Developers Toolkit which
you can download from the IBM software download library.
Chapter 2. Installation 15
The ICSS provides its own version of the Java servlet classes in the
icsclass.zip file, which is part of the product code you download.
Classpath
To use Java servlet support, the CLASSPATH environment variable must
be set as follows before you install the Internet Connection Secure
Server:
CLASSPATH=C:\java_home_directory\lib\classes.zip
When you install the Internet Connection Secure Server, the installation
program will automatically add the icsclass.zip file to your CLASSPATH
environment variable.
In the window shown in Figure 8, select the components you want to install.
We chose the Internet Connection Server and the Security Files.
Chapter 2. Installation 17
NT Service
If you select NT Service, the Internet Connection Secure Server will be
fully integrated with the Windows NT operating system. It will operate
like services that are installed by the operating system itself (such as the
FTP server). We didn′t install this service, because we want to do the
administration from the ICSS panels, as shown later in this chapter.
The window shown in Figure 9 gives you the opportunity to change the
default directory for the ICSS from WWW to anything you like. When you
click on N e x t > , you are presented with two windows that let you:
• Select the ICSS components you want to install
• Overwrite the default directories for the components
To change these paths click on Browse and then select the drive and
directory where you want the ICSS directories installed. Usually, the default
will do fine.
Click on Next to accept the defaults and to continue with the installation.
You will be presented with the window shown in Figure 10 on page 20 to
configure the Internet Connection Secure Server:
Chapter 2. Installation 19
Figure 10. Internet Connection Server - Choose Configuration Parameters
In the window shown in Figure 10 you can change the default configuration
parameters. Table 2 explains them.
Chapter 2. Installation 21
Figure 11. Internet Connection Server - Example of a Front Page
Chapter 2. Installation 23
Netscape Navigator, which extends HTML capabilities and allows you to
open and view live Java applets and applications.
Click on Install if you accept the drive and directory. A window keeps you
informed about the progress of the installation. When the installation is
completed click on Exit.
In Windows NT, execute the .EXE file you downloaded and the installation
will begin.
2.2.3.1 OS/2
Bring up the Netscape Navigator, select Network Preferences from the
Options menu and skip to the third notebook page, Proxies. There, select
Manual Proxy Configuration and then click on View.
This brings up a window in which you type in your SOCKS host. Every
region has its own socks server. We use socks.raleigh.ibm.com. Click on
OK to return to the browser′s window.
Chapter 2. Installation 25
Since we want to use Java we have to ensure that Java is enabled. Select
Security Preferences from the Options menu. In the subsequent window
remove the check mark from Disable Java then close the window.
You have to include the name of the directory that contains your Java
applets in the CLASSPATH statement or applets will not run. Modify the
CLASSPATH statement in the CONFIG.SYS like this:
SET CLASSPATH=
C:\NETSCAPE\njclass.zip;C:\JAVAOS2\lib\jempcl10.zip;c:\myjava;.\.;
2.2.3.2 Windows NT
Bring up the Netscape Communicator and select Preferences from the Edit
menu. In the Preferences window, you can specify what preference
categories you want to edit.
Click on Advanced and ensure that Java is enabled. Next, click on Proxies,
select Manual proxy configuration, and then click on View. In the
subsequent window, type in the Socks field your socks server. Every region
has its own socks server. We use socks.raleigh.ibm.com. The port is 1080.
Click on OK to return to the browser′s window.
You find the classpath environment variable via the windows My Computer,
Control Panel and System in the System Properties window behind the tab
Environment (see Figure 16 on page 29).
CLASSPATH=
.;C:\IBMJAVA\EAB\RUNTIME\IVJEAB.ZIP;C:\IBMJAVA\EAB\RUNTIME\CICSJGATE.ZIP;
http://developer.netscape.com.
Chapter 2. Installation 27
2.3.2 How to Install JDK 1.1.4
Start the installation process with a double-click on the icon of the program
jdk114.exe. This invokes the InstallShield Wizard.
First, you will see a welcome window that is followed by Sun′s license
agreement, and then the window shown in Figure 15. Here you select
which components you want to install.
Make your selections, click on Next, and then follow the instructions until the
installation is finished.
At the end, change your system settings by adding the new JDK directory to
your classpath and path, as shown in Figure 16 on page 29.
CLASSPATH=
... ;C:\jdk1.1.4\bin\classes.zip; ...
Chapter 2. Installation 29
With Version 5, MQSeries installation and administration should be more
familiar to those who have experience with other Software Server
components, reducing training requirements. The new features are:
1. IBM Software Server look and feel is used for installation, definition and
administration of MQSeries.
2. Reliability and serviceability characteristics are now compatible with
IBM Software Server standards.
3. MQSeries publications are provided in HTML format, viewable from a
Web browser.
4. Task guides, similar to wizards, are provided for common administration
tasks.
A Java 1.02 version of the MQSeries Client for Java is available as support
pack. This version works correctly with all of the popular Java-enabled
browsers on the market.
Refer to 2.5, “MQSeries Client for Java” on page 33 for information on how
to obtain and install the support pack.
Select a language (English is the default) and click on N e x t > . Now the
Windows NT InstallShield prepares your system to install the product. Click
on N e x t > until you see the Select Destination Directory window shown in
Figure 17 on page 32.
You can go on with the default values or change the directories by clicking
on the Program... or Data... button at the right side of the Destination
Directory field. There are two entries, one for the program files, the other
for the data files.
Usually, you install into the default directory \MQM. Click on the N e x t >
button to bring up the Choose MQSeries Component window shown in
Figure 18 on page 33.
Here you select what parts of the MQSeries Version 5.0 for Windows NT you
want to install. Clicking on the radio buttons will switch on or off the
Chapter 2. Installation 31
Figure 17. MQSeries - Select Destination Directory
Make your selection, click on the N e x t > button and follow the instructions.
If you accept the defaults displayed in the windows that follow, keep clicking
the N e x t > button until the installation is completed.
In the last window, you are asked if you want to restart your system now or
later. Make a decision and click on the Finish button.
Note: You must reboot your system before you can use MQSeries.
The MQSeries Client for Java enables Web browsers and Java applets to
issue calls and queries to MQSeries giving access to mainframe and legacy
applications over the Internet without the need for any other MQSeries code
on the client machine.
Chapter 2. Installation 33
TOOLS SENDTO WINVMB TOOLS TXPPACS GET MA83 PACKAGE
If you agree with the IBM International Program License Agreement, you will
receive the file MA83.ZIP (about 500 KB in size).
The code is provided in InfoZip compressed format. To unzip these files you
need a program that understands long file names and can re-create
subdirectories. InfoZip does this. You can download it in the form of a
self-extracting executable from the same Web page as the product. The file
name for OS/2 is UNZ520X2.EXE. File names for other platforms may vary.
Note: This is a self-extracting EXE. Execute UNZ520X2 (if you downloaded
the OS/2 version). This will create the file UNZIP.EXE (and several other
files). Use UNZIP.EXE to unzip MA83.ZIP.
unzip MA83
Use the UNZIP.EXE again to unzip the documentation and the executables
for the client.
Open the index.html file in your Web browser and click on the Getting
started with MQSeries Java link to reach the installation instructions. You
find the index.html file in the subdirectory \doc of the directory where you
Chapter 2. Installation 35
2.5.3 Installing the MQSeries Client for Java
MQSeries Client for Java can be installed either on your local hard disk or
on a Web server. Installation on a Web server has the advantage of
allowing you to download and run MQSeries client applications on machines
that do not have the MQSeries Client for Java installed locally.
The MQSeries Client for Java can be run in three different modes:
• From within any Java-enabled browser
• Using an applet viewer
• As a stand-alone Java program
When running from within a browser, the location of the queue managers
that can be accessed may be constrained by the security restrictions of the
browser being used.
Note: If you use an applet viewer or write stand-alone programs, you must
have the Java Developer′s Kit (JDK) installed on the client machine.
When the mqc4j.zip file is unzipped, some files are placed into the current
directory and some files into a subdirectory called com\ibm\mq.
• The files in the root directory are for the installation verification applet
described in the next section.
• The files in the MQ subdirectory constitute the MQSeries Client for Java.
If you have installed the client on your local machine, you must ensure that
the directory in which you unzipped mqc4j.zip is in your CLASSPATH
environment variable.
Examples:
• On DOS, OS/2, or Windows use the command:
set CLASSPATH=%CLASSPATH%;new_dir
• On AIX use the command:
export CLASSPATH=$CLASSPATH:new_dir
Where new_dir is the directory in which you have installed the Java client
files.
• On Windows NT you should use the system environment settings
If the CLASSPATH variable is not set, make it point to the directory in which
you unzipped mqc4j.zip and also to the directory that contains
lib\classes.zip from your JDK installation.
The program connects to a given queue manager, executes all the MQ calls,
and produces simple diagnostic messages in the event of any failures.
Chapter 2. Installation 37
You find a detailed description and an example in 6.11, “How to Test if the
MQSeries Client for Java Works” on page 145.
Before you install the code, read the INSTALL.TXT file entirely for important
information.
Uninstall Beta
Any Beta versions of VisualAge for Java must be uninstalled prior to
installing the Entry Version.
We installed the Entry Version from the CD-ROM, but the installation
process starting from the downloaded file is the same. Just double-click on
the Setup Icon in the setup directory.
After inserting the CD-ROM the installation process starts automatically with
the following screen (which you will not see when starting the installation
from the downloaded version).
Note: If you are installing from a Web downloaded image then be sure to
create a ″tmp″ directory on a FAT or NTFS drive (not HPFS) and unzip the
Web image to yield the actual install programs (″setup.exe″) will not run
from an HPFS drive with a long file name in its directory.
After reading the installation text select Install VisualAge Java and click on
the Next button. If you agree with the licence agreement the InstallShield
will prepare the installation.
Follow the instructions on the screen. You have the option to change the
name of the installation directory. On the last screen, click on Finish.
Chapter 2. Installation 39
Figure 21. VisualAge for Java - Install Components
The installation procedure of the Enterprise Version is the same as for the
Entry Version described in 2.6.1.2, “How to Install the Entry Version” on
page 38.
Warning
Import MQSERVICES first or you get many error messages.
Chapter 2. Installation 41
42 Connecting to the Internet with MQSeries and VisualAge for Java
Chapter 3. MQSeries Overview
With asynchronous messaging, the sending program proceeds with its own
processing without waiting for a reply to its message. In contrast,
synchronous messaging waits for the reply before it resumes processing.
3.1.1 Messages
A message consists of two parts: data that is sent from one program to
another and a message descriptor. The message descriptor identifies the
message (message ID) and contains control information, also called
attributes, such as message type, expiry time, correlation ID, priority, and
the name of the queue for the reply. In MQSeries Version 5, the maximum
message length is 100 MB. Messages can be segmented and grouped.
MQSeries knows four types of messages:
Datagram A message containing information for which no response is
expected.
Request A message for which a reply is requested.
Reply A reply to a request message.
Report A message that describes an event such as the occurrence of an
error.
A program may send messages to another program that runs in the same
machine as the queue manager, or to a program that runs in a remote
system, such as a server or a host. The remote system has its own queue
manager with its own queues. This scenario is shown in Figure 24.
3.1.3.2 Channels
Messages are transmitted via channels. A channel is a logical
communication link. In MQSeries, there are two different kinds of channels:
• Message channel
A message channel connects two queue managers via message channel
agents (MQA). Such a channel is unidirectional. It comprises two
message channel agents (MCA), a sender and a receiver, and a
communication protocol. An MCA is a program that transfers messages
from a transmission queue to a communication link or vice versa. For
bidirectional messaging you have to define two channels, a sender
channel and a receiver channel.
• MQI channel
A Message Queue Interface (MQI) channel connects an MQI client to a
queue manager in a server machine. MQI clients don′t have a queue
manager of their own. An MQI channel is bidirectional.
Figure 29 on page 54 shows the use of both channel types. For more
detailed information refer to the MQSeries Intercommunication .
Typically, there is only one transmission queue for each remote queue
manager (or machine). All messages written to queues owned by a remote
queue manager are actually written to the transmission queue for this
remote queue manager. The messages will then be read from the
transmission queue and sent to the remote queue manager.
Dynamic queues are local queues. They are often used in conversational
applications, to store intermediate results. Dynamic queues can be:
• Temporary queues that do not survive queue manager restarts
• Permanent queues that do survive queue manager restarts
There are some default definitions for objects every queue manager needs.
In MQSeries Version 5, 22 objects are created automatically. The file
AMQSCOMA.TST, supplied with prior versions, does not exist any longer.
Most certainly, you will have to create other objects that pertain to the
applications you run.
The following screen shows how to create a default queue manager with the
name MQNT1. The commands you type are shown in bold.
The commands in Figure 25 start the default queue manager and create the
local queue QUEUE1 for it. Another command alters the queue manager
properties by defining a dead letter queue.
[C:\]strmqm
MQSeries queue manager running.
[C:\]runmqsc
84H2001,6539-B42 (C) Copyright IBM Corp. 1994, 1997. ALL RIGHTS RESERVED
Starting MQSeries Commands.
[C:\]
To start the utility in an interactive mode, type runmqsc. To end it, type end.
This command is new in Version 5, however, Ctrl+C still works.
[C:\]
The input file mycoma.tst contains the following lines. The + indicates that
the command continues on the next line.
****************************************************
* File: MYCOMA.TST
****************************************************
84H2001,6539-B42 (C) Copyright IBM Corp. 1994, 1997. ALL RIGHTS RESERVED
Starting MQSeries Commands.
: ****************************************************
: * File: MYCOMA.TST
: ****************************************************
:
1 : DEFINE QLOCAL (′ QUEUE1′ ) REPLACE +
: DESCR (′ Test Queue′ )
AMQ8006: MQSeries queue created.
:
1 MQSC commands read.
0 commands have a syntax error.
When a slim client cannot connect to its server it cannot work, because
queue manager and queues for a slim client reside in the server. Usually,
an MQSeries client is a slim client. Several of these clients share MQSeries
objects, and the queue manager is one of them, in the server they are
attached to.
Note: The MQSeries Client for Java is a slim client.
You may install client and server software in the same system and use it as
an end user′s workstation. If your operating system is Windows NT you can
install MQSeries for Windows NT V5.0 or MQSeries for Windows V2.1
(MQWin). If your operating system is Windows 95 use MQWin V2.1. This
product has been designed for end users and uses fewer resources.
The difference between an end user′s workstation that is a client and one
that has a queue manager is the way messages are sent. The queues
reside either in the end user′s workstation or in the server.
• Trigger Monitor
• Channel Initiator
• Message Channel Agent (MCA)
Each remote queue must be associated with an xmit queue. Usually, all
messages destined for one remote machine use the same xmit queue.
On the receiving end, a listener program must have been started. The
listener, also supplied with MQSeries, monitors a specified port, by default
the port dedicated to MQSeries, 1414. When a message arrives, it starts the
message channel agent . The MCA moves the message into the specified
local queue using the receiver part of the message channel pair.
Note: Both channel definitions, sender and receiver, must have the same
name. For the reply, you need another message channel pair.
The program that processes the incoming message can be started manually
or automatically. To start the program automatically, an initiation queue
and a process must be associated with the local queue, and the trigger
monitor must be running.
When the program shall start automatically, the MCA puts the incoming
message into the local queue and a trigger message into the initiation
queue. This queue is monitored by the trigger monitor. This program
invokes the application program specified in the process definition. The
application issues an MQGET API to retrieve the message from the local
queue.
Each machine has a queue manager installed and each queue manager
manages several local queues. Messages destined for a remote queue
manager are put into a remote queue . A remote queue is not a real queue;
it is the definition of a local queue in the remote machine. A remote queue
is associated with a transmission (xmit) queue which is a local queue.
Usually, there is one xmit queue for each remote queue manager.
In each system, you must define the appropriate queue manager objects.
The objects are defined in the two .tst files shown in Table 3 on page 59.
Next, start the listeners and the channels. You need to start only the sender
channel in each system. MQSeries starts the receiver.
You may also start the channel initiator from RUNMQSC. The command is:
start chinit
--OR--
start chinit initq(SYSTEM.CHANNEL.INITQ)
Table 5 shows the xmit queue definitions that start the channels
automatically.
Figure 32 on page 62 shows that the queue manager can trigger the
process that starts the channel program in three ways:
• When the first message is put into the transmission queue
• Every time a message is put into the xmit queue
• When the queue contains a specified number of messages
In order to trigger the channels you have to modify the .tst files shown in
Table 3 on page 59. The changes are shown in bold.
Since messages are placed into the xmit queue sporadically, we trigger the
channel every time a message arrives. We use the default initiation queue
for the trigger message.
The next sections describe the MQSeries objects and API sequences in both
sender and receiver systems.
[C:\mqm\tools\c\samples\bin]amqsget SYSTEM.DEFAULT.LOCAL.QUEUE
Sample AMQSGET0 start
message <111111>
message <222222>
message <333333>
no more messages <--- Wait for time out
Sample AMQSGET0 end
[C:\mqm\tools\c\samples\bin]endmqm /i MYQMGR
MQSeries queue manager ending.
MQSeries queue manager ended.
[C:\mqm\tools\c\samples\bin]
********************************************************************/
* File: JAVACOMA.TST */
********************************************************************/
Notes:
1. MQSERVER is the name of the environment variable.
2. JAVACH1 is the name of the channel to be used for communication
between client and server. The channel must be defined in the server.
3. TCP denotes that TCP/IP is to be used to connect to the machine with
the address following the parameter.
4. (1414) is the default port number for MQSeries. You may omit this
parameter if the listener on the server side uses this default, too.
Java Client: For the MQSeries Client for Java, the environment variables are
set in the applet code. An applet can run in any machine, such as a
network station, and it has no access to a disk drive in the workstation. :
The example below shows what statements to include in your Java program:
import com.ibm.mq.*;
..
.
MQEnvironment.hostname = ″9.24.104.456″;
MQEnvironment.channel = ″JAVACH1″ ;
MQEnvironment.port = 1414;
..
.
[C:\mqm\tools\c\samples\bin]amqsgetc JAVAQ1
Sample AMQSGET0 start
message <111111>
message <222222>
message <333333>
no more messages <--- Wait for time out
Sample AMQSGET0 end
[C:\mqm\tools\c\samples\bin]
On the server machine, you see the following listener window after
completion of the two programs:
RUNMQLSR.EXE
The next sections describe the MQSeries objects and API sequences in both
client and server.
Of course, the program can put many message in the queue before it closes
it and disconnects. Closing the queue and disconnecting from the queue
manager could be done when the application ends.
The MQSeries client code that runs in the client machine processes the API
calls and routes them to the machine defined in the environment variable,
such as:
set MQSERVER=JAVACH1/TCP/9.24.1104.206
The definitions for the objects are shown in Figure 40 on page 71.
placed on the trigger queue, the trigger monitor starts the program defined
in the process.
The server program S1 connects to the queue manager, opens the queue
QS1 and issues an MQGET to read the message.
Since several clients use the same server application, it is advisable to give
the server a ″return address,″ that is, the names of the queue and the queue
manager that will receive the reply message. These fields are in the header
of the request message, containing the reply-to-queue manager and
reply-to-queue (here, QA1 or QB1). It is the responsibility of the client
program to specify these values.
Usually, the server program stays active and waits for more messages, at
least for a certain time. For how long can be specified in the wait option of
the MQGET API.
4 This statement closes the output queue. Since the queue is predefined
no close processing takes place (MQOC_NONE).
5 This statement opens QUEUE2 for input only using the queue-defined
defaults. You could also open a queue for browsing, meaning that the
message will not be removed.
6 For the get, the nowait option is used. The MQGET needs the length of
the buffer as input parameter. Since there is no message ID or
correlation ID specified, the first message from the queue is read.
You may specify a wait interval (in milliseconds) here. You can check
the return code to find out if the time has expired and no message
arrived.
7 This statement closes the input queue.
8 The application disconnects from the queue manager.
To help you understand the overall configuration, it also provides you with
an interactive diagram that identifies each object it configures. MQFirst
uses MQI calls and MQSeries commands to configure the objects. You can
view these commands at any time, and save them in a file for future use.
Finally, MQFirst leads the way for further learning about MQSeries
depending on your needs.
The file you download is mqfirst.zip and needs about 2.7 MB.
To run the program, click on Start, then on Programs and then on MQSeries
FirstSteps for Windows.
MQFirst presents a welcome window, which lets you choose between two
options:
• Click on Guide Me when MQSeries is new to you.
• Click on Quick Start to quickly configure an MQSeries system.
On the bottom of each window is a message area. You specify what kind of
status messages you want to see:
• Messages displayed by the application (MQFirst)
• Messages related to MQI calls
• Messages from the MQSC utility
• All messages
The first messages appear in the fifth window.
The first four windows tell you about some MQSeries basics and how to
proceed with the guided tour.
On page four, MQFirst tells you that it needs a queue manager to connect
to. It uses the machine name as queue manager name. You cannot change
the name.
Click on Next and MQFirst tries to connect to the queue manager. If it does
not exist, MQFirst creates it and its objects, including a dead letter queue.
MQFirst uses the command server to create the objects it needs. When you
click on Next on page 5, MQFirst checks whether the command server is
running or not. If not, MQFirst issues an strmqcsr command to start it. In
the message area, three more messages are displayed:
Starting the command server.
Command run:strmqcsr brasch
Command server is OK.
MQFirst tells you on page six, shown in Figure 44 on page 82, that channel
definitions are needed at both ends of the link. You see a graph that
elucidates the sender and receiver. The programs that transfer the
messages over the network are called message channel agents (MCA).
The listener program listens for incoming messages and activates the
receiving MCA when a message has arrived.
The graph shows also a transmission queue on the sender side and three
local queues from which the applications get their messages.
Click on Next and MQFirst prepares for remote operations, even though you
can run it in one machine. You see three more messages on page 7:
MQFirst also displays the names of the queue manager and queue it wants
to use for incoming messages. You may change the queue name from
default to anything you like. When the queue is created you see the
following messages:
MQSC:+ Define a local queue ′ MQFIRST.default′
MQI :MQOPEN(Queue:′ MQFIRST.default′ ) for exclusive input
In the eighth window, you are asked to provide the queue manager name
and a queue name for outgoing messages. If you want to work only with a
local queue manager (running the verification of the installation only on one
system), key in your local queue manager name.
Note: As soon as you enter the local queue manager name, the queue
name changes from default to defaultother.
MQFirst creates now the second queue and displays the following
messages:
MQSC:+ Define a local queue ′ MQFIRST.defaultother′
MQI :MQOPEN(Queue:′ MQFIRST.defaultother′ ) for output
Ready to exchange messages with ′ defaultother′ .
If you are running MQFirst in two machines, then you can test the
connection when you key in the name of the remote MQ Queue Manager.
You are now ready to send and receive messages. In this example, we use
one machine with one queue manager.
Click on Next and the window shown in Figure 46 on page 84 will appear.
Type your first message in the message text field at the top of the window.
Also, mark Request Automatic Replies To Messages You Send. MQFirst then
automatically replies to the message you send (echo).
Now click on Put Message and MQSeries puts the message in the queue
with the name default. You will see the reply in the lower message area of
the window.
Send some additional messages and see on the ninth MQFirst page a
message displayed for each MQPUT issued.
Now close the message window. You just completed your first connection
with MQSeries by clicking some buttons.
Next, you see the main window of MQFirst. That is the window you would
have seen had you selected Quick Start instead of Guided Tour.
The connections are displayed only after a message exchange takes place.
Move the cursor over one of the objects in the graph and MQFirst will
display object type and name.
This chapter is a brief introduction into Java and is intended for those
readers who have no experience with this evolving programming language.
Figure 49 on page 88 shows how Java and C programs are compiled and
distributed. It shows that the bytecode generated by any Java compiler will
run on any machine that supports Java.
With Java you already get a lot of classes for the main functions you need.
So it is easy to start writing your first application or applet. The following
packages are included in Java:
• Language Package (java.lang.class)
This package provides the elementary classes for strings, arrays and
elementary data types.
• Utility Package (java.util.class)
This package includes classes for the support of handling vectors,
stacks, hash tables, encoding and decoding.
• I/O Package (java.io.class)
With this package you get classes for standard input and output, as well
as file I/O.
• Applet Package (java.applet.class)
This package provides support to interact with the browser.
• Abstract Window Toolkit (AWT) Package (java.awt.class)
This package was used mainly by us to build the GUI (graphical user
interface). It provides support to control the visual aspects of your
application or applet. Objects such as buttons, scroll bars, text fields,
lists and fonts are available in this class.
• Network Package (java.net.class)
For communication with other applications, this package provides the
basic support to communicate with peer programs over the network, as
well as standard protocols, such as TCP, FTP and URL access.
In the JDK Version 1.1 are some enhancements of existing classes, some
new features and also some performance improvements. The new features
are:
Once loaded, the program runs inside a Java virtual machine. The virtual
machine is a controlled environment where the Java bytecode is interpreted
and translated into machine language.
First, create a directory to store your HTML files and your Java applet and
application files.
[C:\]md myjava
[C:\]cd myjava
[C:\myjava]
Ensure that the name of the directory is in the CLASSPATH environment
variable in the CONFIG.SYS:
SET CLASSPATH=C:\NETSCAPE\njclass.zip;C:\JAVAOS2\lib\jempcl10.zip;c:\myjava;.\.;
Now using your favorite editor, type the source code of your first Java
application.
class Hello {
public static void main (String args[]) {
System.out.println(″Hello World!″ ) ;
System.out.println(″Welcome to MQSeries Client for Java.″ )
}
}
[C:\myjava]
5.3.2 The Hello World Applet
An applet is always called from within an HTML file. Therefore, we have to
create two files:
1. The Java program HelloWorld.java
2. The HTML file HelloWorld.html
import java.awt.Graphics;
public class HelloWorld extends java.applet.Applet {
public void init () {
resize (300,200);
}
public void paint (Graphics g) {
g.drawRect(0,0,getSize().width - 1, getSize().height - 1);
g.drawString(″Hello World!″, 25, 25);
g.drawString(″Welcome to MQSeries Client for Java.″,25,50);
}
}
Note: Depending on the eight character long names in a FAT file system,
you should rename the ....jav files after downloading on a hard disk to the
original names as described in this book.
<HTML>
<HEAD><TITLE>A Simple Program</TITLE>
</HEAD>
<BODY>
Here is the output of my program:
<APPLET CODE=″HelloWorld.class″ WIDTH=300 HEIGHT=200>
</APPLET>
</BODY>
</HTML>
Note: For more detail about HTML you should look in book stores. You will
find a lot of good books about HTML. Look for the newest release numbers.
-- or --
[C:\myjava]applet HelloWorld.html
Note: In some operating systems the name of the appletviewer EXE is
applet, in others appletviewer.
Once you have successfully completed all the above steps, you should see
the applet in your window:
Important
Do not invoke the applet viewer from the HTML directory if you might
want to reload the applet. Because of the way the class loader works,
an applet can′t be reloaded (for example, after you make changes to its
code) when you invoke the applet viewer from the directory that contains
the applet′s compiled code.
In this redbook we don′t describe the Java language in more detail, because
there are so many good books available.
If you are familiar with programming in C, you should have a look at the
book Java in a Nutshell by David Flanagan (ISBN 1-56592-183-6).
But if you are a beginner, you can try the book Teach Yourself Java in 21
Days by Laura Lemay and Charles L.Perkins (ISBN 1-57521-030-4).
The VisualAge Quick Start window aids you in selecting what to do next. It
provides a fast path to creating applets, classes, and interfaces. It is
automatically shown when VisualAge for Java is started for the first time.
You may decide whether you want to see it every time the program starts or
not.
100 Connecting to the Internet with MQSeries and VisualAge for Java
In the next window, shown in Figure 54 on page 101, type the names of the
following:
• Applet (VAJavaTestView)
• Project (MQandJava)
• Package (Example)
VisualAge for Java suggests that you give your applets (and all other
classes) names that begin with a capital letter. Class names are
case-sensitive, and cannot contain spaces. If a class name consists of
multiple words, do not type spaces between the words, but instead
capitalize the first letter of each word.
Next, mark the check box that lets you design your applet visually and click
on Finish.
VisualAge for Java now creates the project, package and applet you
specified in the previous window and opens the Composition Editor with an
empty work area as shown in Figure 55 on page 102.
When you build your new applet in the Visual Composition Editor, you are
visually manipulating JavaBeans. These JavaBeans (or, simply, beans) are
represented as classes when you examine your applet in the Workbench.
When working with beans in VisualAge for Java, you use the following
fundamental techniques:
• Dragging beans
• Selecting multiple beans
• Displaying pop-up menus
When you build a Graphical User Interface (GUI), you work with categories
of beans. These are shown on the left side of the Composition Editor. The
left column contains the categories and the column to the right of it contains
the beans (parts in VisualAge for Smalltalk).
To place a bean in the working area, click on it and then click in the work
area where you want to place it. If you want to place the same bean
several times in the GUI, activate the Sticky radio button, But don′t forget to
deactivate the button if you don′t need it any longer.
To select multiple beans, hold down the control (Ctrl) key and click mouse
button 1 on the items you want to select. This is of use if you want, for
example, to align different fields (labels and text fields) with the buttons on
top of the work area.
102 Connecting to the Internet with MQSeries and VisualAge for Java
To display a pop-up menu, click mouse button 2 on the object.
1. Click on this icon representing the Data Entry category from the
container on the left. This category contains three beans.
2. Then select the text field from the right column of the beans
palette.
3. Check Sticky below the beans palette and with the left mouse button,
click where in the work area you want to place the first and the second
4. From the same category select the Label bean and place two
labels in the GUI in the same fashion as for the text field in the previous
step.
Don′t worry about their exact positions. Later you will learn how to use
the tools from the tool bar to match sizes and align beans.
6. Click on the push button symbol and add two buttons to the
applet between the text fields.
8. Place the variable into the white space outside the applet.
This is a non-visual bean that does not belong in the GUI.
Note: Don′t forget to unmark the sticky check box.
You have now placed all parts into your GUI. The next step is to change the
properties of the various parts.
104 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 57. VisualAge for Java - Push Button Properties
In the Fonts window, you can set the font attributes. We selected:
Font Name timesroman
Style Bold
Point Size 14
When you are done, click on OK.
4. Change properties of the second push button.
Don′t close the Properties window yet. Click on the right push button
and the Properties windows displays the properties of Button2. Name
the bean ReceiveButton, give it the label Receive and the same fonts as
the Send button.
In the same manner you can change the labels, so that they look as
shown in Figure 56 on page 103. The font is the same as for the push
buttons. Now close the Properties window.
5. Change the name of the variable.
Next, change the name of the non-visual object to MessageQueue. With
the right mouse button, click on Object1 and select Change BeanName.
You are now presented with the Bean Name Change Request window
shown in Figure 59 on page 107. Type the new name and click on OK.
106 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 59. VisualAge for Java - Change Bean Name
• Click on the Align Left button and all fields are aligned with
the field on the top.
You have now finished with the alignment of the objects. The GUI should
now look like the one shown in Figure 56 on page 103.
108 Connecting to the Internet with MQSeries and VisualAge for Java
1. Select the Receive button and click mouse button 2.
2. Select Connect, then actionPerformed(java.awt.event.ActionEvent).
3. Click mouse button 1 over the ReceiveTextField, then select text from
the pop-up menu.
Again, a dashed line appears. The value of the parameter for the
getMessageQueue method is missing. A parameter-from-property
connection that specifies what to get must be programmed.
4. Move the mouse pointer on top of the dashed connection line.
5. Click mouse button 2, select Connect and then value from the pop-up.
6. Click mouse button 1 on the MessageQueue object and select text from
the pop-up.
Now your applet should look like the one in Figure 60.
When you click on this test button in the Icon Menu Bar, VisualAge
for Java will:
• Save your code.
• Compile and generate runtime code.
• Display a Setting window which lets you change width and height of the
applet.
Click on Run and the appletviewer starts the applet.
110 Connecting to the Internet with MQSeries and VisualAge for Java
5.4.6 Methods Generated by VisualAge for Java
Let us look at the methods VisualAge for Java generated as we built the GUI
and connected the beans. The complete list of this methods is shown in
Figure 62.
You can see that in this (and also in the other) method is indicated where
you can type your own Java code. We will do that in the next example in
Chapter 6, “An MQSeries Application” on page 119.
112 Connecting to the Internet with MQSeries and VisualAge for Java
5.4.7 Versioning and Exporting a Package
You can export a package or a class. Before you can export a package or a
class you have to give it a version number.
114 Connecting to the Internet with MQSeries and VisualAge for Java
Now you can export the package Example.
• Highlight its name in the Projects window.
• Select File from the menu bar.
• Select Export from the menu. The SmartGuide displays the window
shown in Figure 66.
• Activate the Interchange-File radio button.
• Click on Next. The SmartGuide displays the window shown in Figure 67
on page 115.
• Type a file name, such as fbexamp1.dat, or browse to find a directory
and name.
• Click on Finish and the SmartGuide will create the file.
Now the example has been stored in your repository. The following steps
describe how you import the package MQRedbookExample into your work
space.
• Click on the Projects tab in the Workbench window.
• Click on your project to highlight it.
• Click the right mouse button (button 2).
• Select Add Package from the pop-up menu.
• In the Add Package window, select the radio button for Add package(s)
from the repository.
• Click on Browse.
• Select the package MQRedbookExample from the available package
names list.
• Select version 1.1 from Editions list.
• Click on the > > button.
• Highlight MQRedbookExample 1.1 in the Editions to Add list.
• Click on OK.
• Click on Finish in the Add package window.
Figure 68 on page 117 shows that the package containing the examples is
added to your project.
116 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 68. Import a Package
The two programs are very basic and demonstrate only the use of the
MQSeries APIs. Both applet and server programs have a GUI in which the
user can enter all values necessary to build a connection. This makes the
application flexible so that it can be used as an installation verification
program.
Figure 70 shows the applet and Figure 71 on page 121 shows the GUI of the
server program.
Throughout the rest of this chapter we describe how to build both programs
and how to run them.
120 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 71. MQSeries Application - Server
The programs can run in one or two machines depending on the MQSeries
definitions you provide. You can also test the applet in the machine where
the queue manager is installed. That is usually the case in a test
environment. You may also run the programs independently of each other.
Diskette
This application is on the diskette that accompanies this book.
Place these objects into the GUI as shown in Figure 70 on page 120. How
to do that is described in 5.3, “A First Try with Java” on page 93. Don′ t
forget to match the sizes of the objects and align them.
Of course, you can use different fonts and choose different arrangements of
the fields and buttons.
Note: To give the user some control over the server program, we built a
GUI for it, too. The server program is an application and not and applet.
Refer to 6.9.1, “Writing an MQSeries Server Application” on page 140 for
more information.
122 Connecting to the Internet with MQSeries and VisualAge for Java
6.2 Writing a Method
After the GUI is created, you must write some methods that invoke the
MQSeries APIs. Unlike VisualAge for Smalltalk, VisualAge for Java does not
have MQSeries beans.
Before we write the methods associated with the push buttons, let us
discuss, in general, how to create a method, how it gets invoked and how it
obtains data from the text fields.
5. Click on Finish.
6. From the methods listed on the Methods tab, select the method you just
created.
7. This displays the Java-generated method skeleton in the Source field.
Here you add the code for the method.
8. After you have completed the source code, click the right mouse button
and select Save to save and compile the source code.
The methods we have to write for this application invoke seven MQSeries
APIs which will be discussed later. The methods and their parameters are:
• connectToQmgr(String queueManagerName, String hostname, String
channel, String portnumber)
• disconnectFromQmgr()
• openQueue(String queueName, String queueManagerName)
• putMessage(String inputMessage)
• retrieveMessage()
• closeQueue()
• disconnectFromQmgr()
Other methods will be generated by VisualAge for Java.
124 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 74. MQExample1 - Writing a Method
126 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 76 on page 127 shows the Visual Composition editor after the
connection is completed. You may connect the text of several text fields
with the method. VisualAge for Java generates the code that gives the text
of those fields to the method as parameters whenever the associated event,
that is, a mouse click occurs.
The following steps describe how to create the part of the applet shown in
Figure 77.
1. If you have not already done so, use the Visual Composition editor to
create the appropriate text fields that will contain the parameter values
required to connect to a queue manager. These are:
• Queue manager name
• Channel name
• Host name
• Port number
2. Create a push button that initiates the connection to the queue manager.
3. Use the Methods editor to create the new method connectToQmgr using
the parameters shown in the table below.
128 Connecting to the Internet with MQSeries and VisualAge for Java
4. Write the source code shown in Figure 78 on page 129.
130 Connecting to the Internet with MQSeries and VisualAge for Java
Table 7. Method disconnectFromQmgr and Parameters
Method disconnectFromQmgr()
Input none
Return void
Flow
The program contains a try and catch block. The try block calls the
disconnect() method of the queue manager object. The exception
handler displays a message when the disconnect fails.
To add a push button that opens a queue you specify in the applet follow
these steps:
1. Use the Visual Composition editor to add to the GUI a text field for the
queue name. The queue manager name is in the same field that is
used for the connect.
2. Create a push button that initiates the opening of the queue.
3. Use the Methods editor to create the method openQueue.
132 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 82. MQExample1 - Open a Queue
134 Connecting to the Internet with MQSeries and VisualAge for Java
• A push button that initiates putting message in the queue
2. Use the Methods editor to create the new method putMessage.
3. Write the source code as shown in Figure 85 using the parameters in
the table below.
• First create a new MQMessage object with the name inputMsg. This
message will hold the data the applet user types.
• The method receives the user data as parameter inputMessage.
Write the message data into the buffer, inputMsg, using the
writeUTF() method of the message object.
136 Connecting to the Internet with MQSeries and VisualAge for Java
6.8 How to Get a Message from a Queue
In this example, the applet user can click on the Receive button to get a
message from the specified queue and display the data in the Output
Message text field. The following steps tell you how to do this.
1. If not already done, add two objects to the GUI:
• A text field to display the received message
• A push button that initiates getting a message from the queue
138 Connecting to the Internet with MQSeries and VisualAge for Java
• The readUTF() method of the message object reads the message
from the buffer and stores the data in outputMessage. This field will
be used to display the data.
• When an exception occurs an error message will be displayed.
4. Use the Visual Composition editor to make an event-to-method
connection between the push button and the receiveMessage method.
5. To display the message returned in outputMessage in the Output
Message text field, you must connect the text property of the text field
and normalResult of the event-to-method connection between the button
and the method.
• Click on the event-to-method connection between the Receive button
and the method.
• Select Connect from the menu and then normalResult.
• Drop the spider into the Output Message field and select text from
the pop-up.
You just built an event-to-method connection between the
event-to-method connection and the Output Message text field.
For applets (MQSeries Client for Java), you use the mq class library; for
MQSeries server programs (Java applications) you use the bindings in the
mqbind class library instead.
Figure 71 on page 121 and Figure 91 on page 142 show the user interface
for the server application. It contains:
140 Connecting to the Internet with MQSeries and VisualAge for Java
• Put a message in the queue
• Get a message from the queue
• Close the queue
• Disconnect from the queue manager
Since the MQSeries functions for the client and server are the same and
Java is object oriented, we can re-use the methods created for the client
application. However, there is one exception. The method that connects to
the queue manager does not need the environment settings.
The diskette provides three sample definition (.tst) files for running client
and server programs on the same machine, and for running the applet and
the application in two machines.
142 Connecting to the Internet with MQSeries and VisualAge for Java
6.10.1 Preparation
Before you test the applet prepare your system with the following steps:
• Make sure that the queue manager is running: strmqm
• Make sure that the Server Connection Channel (SVRCONN) is created
on the MQ Server. You can use SYSTEM.DEF.SVRCONN which is
created as one of the default objects, or you create your own, such as:
DEFINE CHANNEL(MQVAJ.CH1) REPLACE +
CHLTYPE(SVRCONN) +
TRPTYPE(TCP) MCAUSER(′ ′) +
DESCR(′ Server channel for client′ )
• Make sure that a local queue is defined. You may use
SYSTEM.DEFAULT.LOCAL.QUEUE or define your own, such as:
DEFINE QLOCAL(ISHI.SENDQ) REPLACE +
DESCR(′ Queue for input from Java client′ )
• Make sure that the MQSeries channel listener is running:
start runmqlsr -t tcp
To start the server program, open another window and type the command:
java MQExample2
Then fill in the text fields in one or both applets and click on the buttons to
test the MQSeries functions. When the applet is running, you will see a GUI
as shown in Figure 92 on page 144.
• In the Queue Manager Name field, enter the queue manager name to
which you want to connect. If you test both client and server programs,
enter the same name.
• In the Channel Name field, enter the channel name to be used to
connect to the queue manager.
• In the TCP/IP Host Name field, type the TCP/IP host name in which the
queue manager is running.
• In the TCP/IP port number field, type the port number to be used. The
default is 1414.
• Click on the Connect button to connect to the queue manager.
• In the Queue Name field, enter the name of the queue you want to open.
If you test both client and server programs, enter the same name.
• Click on the Open button to open the queue.
• Type some text in the Input Message text field.
• Click on the Send button to put the message in the queue.
• Click on the Receive button to get the message from the queue. This
will display the message in the Output Message text field.
Start your appletviewer from a command prompt in a window and you will
see the various messages produced by the methods. The messages are
only for demonstration purposes. They allow you to see what happens in
144 Connecting to the Internet with MQSeries and VisualAge for Java
the program when you step from connect to disconnect. Figure 93 on
page 145 shows the messages you see when you get and put a message.
C:\myjava>appletviewer MQExample1.html
Connected to Queue Manager: WTR05405 TCP/IP hostname: wtr05405 Channel
name SYSTEM.DEF.SVRCONN TCP/IP port number 1414
Queue Opened: SYSTEM.DEFAULT.LOCAL.QUEUE
Message hat been put
Message has been gotten
Close Queue
Disconnect from Queue Manager
146 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 95. Verify Installation Results
This chapter provides a brief description of the IMS bridge and the Open
Transaction Manager Access (OTMA) facility.
Notes:
1. XCF is a communication protocol that allows two different MVS
applications to communicate. The two applications can stay on different
MVS systems provided those MVS systems belong to the same Sysplex
(that means they can communicate over XCF).
2. OTMA and the IMS bridge are implementations of the the XCF protocol.
Through OTMA, clients can send transactions to IMS and receive output
from IMS applications or IMS itself.
Discussing this in great detail is out of the scope of this redbook. However,
you should consider that the prefix contains information such as:
• The user ID that originated the transaction.
• The Tpipe, a term introduced with OTMA, that in the OTMA world takes
the place of the traditional LTERM. In contrast to LTERM, Tpipes do not
need to be assigned in IMS, as they are automatically allocated.
• The type of the message, such as IMS command or IMS transaction.
150 Connecting to the Internet with MQSeries and VisualAge for Java
again be available to the client when the IMS response comes back. So
the client will be able to remember to what IP address the output has to
be sent.
• Existing IMS applications can run without modification and interact with
OTMA clients.
• An OTMA client can submit an IMS transaction and issue commands,
such as /DIS A.
• Messages that go through OTMA can have an extension in the User
Data Section of the message prefix. This allows the client to correlate
the input with the output.
• An OTMA client can implement functions that IMS does not provide.
• OTMA is out of the scope of a traditional COBOL programmer.
Remark
It is the ultimate responsibility of the client application to deliver the
output to the originating end user. IMS cannot deliver it, as it is only
aware of the client.
Figure 96 on page 150 shows, in general, the access to IMS. You can
access IMS from a device through VTAM. In this case OTMA is not
involved. From the same device, you can go through a client that exploits
OTMA. In this case, the device is supported by the client that converses
with IMS through OTMA.
MQSeries for MVS/ESA behaves like the client side of an OTMA connection.
It allows any MQI application to integrate IMS transactions. Unlike native
OTMA, the IMS Bridge is simple to use.
IMS and MQSeries have interfaced since the first release of MQSeries for
MVS/ESA (1993), through the so called IMS adapter . The IMS adapter is
equivalent to the CICS adapter . The IMS adapter allows an IMS application
to issue MQI verbs, such as MQCONN, MQGET and MQPUT.
With the IMS Bridge, an IMS application can get and put messages to an
MQSeries queue without using explicit MQI verbs. Remember, the IMS
Bridge is an OTMA implementation.
The original message should always contain the return address, that is the
ReplyTo information in the Message Descriptor.
The IMS application can get the incoming message through the standard
IMS interface (GU IOPCB). OTMA and IMS take care of the ″triggering″ and
getting the message to the IMS application.
The IMS application produces its output through the standard IMS interface
(ISTR IOPCB).
The IMS Bridge (and OTMA) maps the IMS outgoing message to a
MQSeries message that is sent to the ReplyToQ and ReplyToQMgr specified
in the incoming message.
The originating generic MQ application can retrieve the response from IMS
with an MQGET call.
The IMS Bridge introduces implicit MQI support. This means that any
application can interact with an IMS application issuing MQI verbs. The IMS
Bridge maps the MQSeries message to an incoming IMS message and
again it maps the outgoing IMS message to an MQSeries queue.
152 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 97. IMS Standard Triggering with MQSeries
The IMS application is not aware that the partner is an MQI application. To
be more precise, the IMS application is not aware that the transaction has
been entered through OTMA. The same IMS transaction could have been
scheduled either from an old 3270 terminal or from an MQI application in a
client/server environment.
Summary: The IMS Bridge, that is part of MQSeries for MVS/ESA, behaves
like an OTMA client. This means that it communicates to IMS OTMA
through the XCF interface. Figure 98 on page 154 shows the basic flow.
IMS and MQSeries communicate over the IMS Bridge, provided that they
belong to the same XCF group. IMS and MQSeries can belong either to the
same MVS system or to different MVS systems that are part of the same
sysplex. In any case, there is no need of a coupling facility, and XCF does
not require it.
154 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 99. IMS Bridge - Detailed View
156 Connecting to the Internet with MQSeries and VisualAge for Java
The message that is passed to IMS can be built from several segments
which must be concatenated. Examples of how such a message could look
are:
<MQIIH> <LLZZ> <Trancode> <IMS user data> <LLZZ> <Data> ....
The following shows the parts of an MQ message with an MQIIH that is sent
to IMS:
Note: For the complete details of the fields contained in the Message
Descriptor and IMS Header, refer to the MQSeries Application Programming
Reference , SC33-1673.
Table 12 shows some of the most important fields. For example, note that
the UserIdentifier of the message is part of the standard Message
descriptor. This field will definitely be passed on to the IMS application if
the proper security options are in effect, and it is carried in the Message
Descriptor, as is usual in the MQSeries world.
The IMS header contains other information that is more specific to the IMS
world. If for example, the IMS program that has to be run has some
dependencies on the LTERM or the MOD name, this information can be
supplied with the fields LTermOverride and MFSMapName.
The field Authenticator can contain the user password that allows IMS to
identify the user ID when the appropriate security options are set.
Through the fields TranState and TranInstanceId, the MQI program that is
partner of IMS can understand whether or not the IMS application is in
conversation, as this word is defined in IMS.
The incoming message (request) should always contain the following two
fields:
• Reply-To-Queue
• Reply-To-Queue Manager
This ″return address″ allows the IMS Bridge to send responses back to the
originating system. The response includes:
• Replies from the IMS application
• Messages from IMS when it is not able to complete the transaction, for
example the transaction is stopped.
If the IMS Bridge is not able to put the reply message on the reply-to-queue,
for any reason, such as the reply-to-queue has not been supplied, it puts it
into the Dead-Letter queue. If this also fails, the traffic between IMS and the
IMS Bridge could stop, so impacting the entire system.
158 Connecting to the Internet with MQSeries and VisualAge for Java
• The Message Descriptor specifies Format=MQFMT_IMS
• The IMS Header MQIIH specifies both:
Format=MQFMT_IMS_VAR_STRING
ReplyToFormat=MQFMT_IMS_VAR_STRING
When using messages structured with the MQIIH, we recommend that the
IMS part is all text, apart from LL and ZZ fields. This is quite common in the
IMS world, as the IMS users, usually, send text data to the IMS transactions.
If this assumption applies, the Format field in the Message descriptor must
be MQFMT_IMS, while the Format field in the MQIIH must be
MQFMT_IMS_VAR_STRING. This way, conversion is done automatically for
IMS by MQSeries.
If the incoming message has the format LLZZ + IMS data, that is, there is
no MQIIH header, the Format field of the Message descriptor should be
MQFMT_IMS_VAR_STRING. The same recommendation applies: messages
should always be translated at the host.
If the IMS message is not made up of text only, but, for example, it contains
binary and packed decimals, it should be translated under user
responsibility. The user should supply the conversion exits, possibly in the
host environment, with a conversion logic that is user-dependent.
Sometimes, the IMS Bridge has been used to interface IMS transactions
with other IMS transactions, even in the same IMS system. This can happen
when there is a need to implement the concept of ″workflow management″
where the business is divided into ″business requests″. A business request
is typically made up by more than one IMS transaction. Consider the
example of opening a new checking account at a bank. The teller should
run the transaction that collects general data about the customer, such as
name, address and so on. Then the teller should enter the transaction that
opens a new account. After that he should probably run the transaction that
delivers the check books.
Probably, all these transactions already exit in the bank information system,
and they could be reused.
When the BMP has received the request and validated it, it starts a MPP
region that could take the charge of the business request. This MPP
program, in turn, can use the IMS Bridge to schedule the existing IMS
transactions that make up the business request. If this program is smart
enough, it could start all the transactions at the same time, getting the
answers when all of them have finished. This could lead to a higher
parallelism of the business.
There are other customers who have decided to use the IMS Bridge instead
of the MQSeries trigger mechanism, because of the better scheduling
mechanism that IMS offers compared with the mechanism offered by the
MQSeries trigger.
160 Connecting to the Internet with MQSeries and VisualAge for Java
Chapter 8. Connecting the Internet to IMS
In this chapter, we describe how to write a program, with VisualAge for Java
and MQSeries, that connects the user of an Internet or Intranet terminal to a
legacy system, in this case IMS on MVS. In the following sections, we
discuss:
• The purpose of the applet and application
• What software is needed
• What to do before running the example
• The logic of the applet
• How to create the applet with VisualAge for Java
• The logic of the Java application
• How to create the application with VisualAge for Java
The user of the example is able to access an IMS application from a Web
browser. A Java applet runs within the browser and displays a GUI
containing an employee record request form. The user inputs fields and
submits the form. The request is sent to an MQSeries queue on the Web
server. There, a Java application is triggered which gets the message off
the queue, logs the transaction to a file, and forwards the message to a
queue on the MVS system. The IMS application retrieves the message,
processes the request, and sends the reply back to an MQSeries queue on
the Web server. The Java applet then gets the reply message off the queue
and displays the result within the Web browser.
Figure 100 on page 162 illustrates the message flow. If you want to run this
example on your system you need to implement (or model) a similar
systems design.
162 Connecting to the Internet with MQSeries and VisualAge for Java
3. On the third tier, the MVS system, the following is required:
• IMS
• IMS Bridge
• IMS sample application IVTNO (shipped with the product)
• MQSeries Server
4. For development install on any platform which supports VisualAge for
Java:
• VisualAge for Java 1.1
• JDK (we are using 1.1.4)
With the file WEBSRVR.TST, you create the queue manager objects for the
Web server machine. The file can be run through the runmqsc facility. This
assumes that a queue manager is running on the Web server.
WEBSRVR.TST creates the following objects:
• Three local queues used by the application and applet
• One transmission queue
• One sender channel to MVS system
• One receiver channel from MVS system
• One process for triggering the channel
Use the file MVS.TST on the MVS system. Run it through the batch utility on
MVS or define the objects through the MQSeries panels. Again, you need to
have a functioning queue manager on this system. MVS.TST contains
definitions for the following:
• One local queue used by the IMS Bridge
• One transmission queue
• One sender channel to Web server machine
• One receiver channel from Web server machine
• One process for triggering the channel
The MQSeries Client for Java is used to write Java applets. You have to
import com.ibm.mq in your applet program in order to communicate with
MQSeries as a client. You do not need an MQSeries server on the machine
where the applet runs.
164 Connecting to the Internet with MQSeries and VisualAge for Java
• It creates a message, formatting the user data into a valid IMS
transaction.
• The message is put on the output queue, destined for the IMS
application in the host.
Note: The queues for the client application are managed by the MQM
that resides in the Web server machine.
• It waits until the reply message from IMS arrives in the input queue
located in the Web server machine.
• It parses the reply message and displays the result of the requested
action in the text fields of the applet.
To add a new project for development of the applet, follow these steps:
• With the right mouse button, click on the upper half of the Workbench
window.
• Select Add Project from the pop-up.
• Type a name, such as RedbookExamples, in the subsequent SmartGuide
- Add Project window.
• Click on Finish and the project will be created.
Then add a new package for the applet in the following way:
• Make sure that the newly created project is highlighted.
• With the right mouse button, click on the upper half of the Workbench
window.
To display a button, for example, click first on the button category icon in
the left of the two columns. Then choose from the right column a button
type, such as the push button. Click on it and move the cursor in the white
space in the editor. To drop the object, click the left mouse button. This
creates a button in the GUI. You can move or resize it within the dotted
rectangle.
Before you start building the GUI, you may want to enlarge the editor
window and also the viewable area of the applet. To make the GUI bigger,
click somewhere inside the dotted rectangle so that small black squares
appear in each corner. Then grab one of the black corners and drag it until
you think the size is right.
166 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 101. WWW-IMS Example - Employee Record Layout
4 text fields for the name, phone extension and ZIP code
If you want to change the text properties for the labels and buttons
double-click on the object and change the text field (for labels) and label
field (for buttons).
168 Connecting to the Internet with MQSeries and VisualAge for Java
The applet needs the classes to communicate with MQSeries via the
client connection.
Now save the code. With the right mouse button, click somewhere in the
source code area and select Save from the menu. You also want to save
the workspace.
We add one item for each of the four actions to the list
DISPLAY
ADD
UPDATE
DELETE
• You can open the method getChoice1() three ways:
− From the Projects tab in the Workbench
− From the Methods tab in the editor window
− From the Hierarchy tab in the editor window
Scroll down to the method getChoice1() and click on it. The code
generated by VisualAge will appear.
• Add your (user) code as shown in bold in Figure 103 on page 170.
• Make sure that these four strings are exactly 8 characters long. Pad
them with blanks at the end. This is important for the message format
we send to IMS.
• Now you can test if the list box works. Go to the Visual Composition
170 Connecting to the Internet with MQSeries and VisualAge for Java
− With the right mouse button, click once on the Clear button again.
− From the menus choose Connect and then
actionPerformed(java.awt.event.ActionEvent).
− The pointer changes to a spider. Move the spider into the text field
Last Name and click the left mouse button.
− From the menu, select text.
− You should now see a dotted line from the Clear button to the text
field. Click once with the left mouse button on the line so that it is
highlighted.
− With the right mouse button, click on the same line and choose
Properties from the menu. You will see the Event-to-method
connection properties.
− Hit OK again to get out of the dialogue window. The line should now
be solid instead of dashed.
• Repeat the above steps to create connections from the Clear button to
the other three text fields.
• In the same way, build a connection between the Clear button and the
text area on the bottom of the GUI. .
• Create another actionPerformed connection from the Clear button to the
choice list. Instead of specifying ″text″ as the method, choose
select(java.lang.String).
• Double click on the resulting dashed line to bring up the
event-to-method dialogue window.
• Click on the Set Parameters button and type as value for str DISPLAY,
followed by one space. The value must be eight characters long.
172 Connecting to the Internet with MQSeries and VisualAge for Java
• Click on OK and again in the next window. This will cause the list box
to show DISPLAY when the clear button is pressed.
Figure 104 on page 172 shows the connections we just made.
Now save the GUI. From the file menu, choose Save Bean. You can run the
applet developed so far and test if the clear functions work.
Select Test from the Tools menu or click on the test button shown
on the left. In the subsequent Settings window, click on Run.
174 Connecting to the Internet with MQSeries and VisualAge for Java
try {
int portnum;
try {
portnum = new Integer(portnumber).intValue(); // convert String to Int
} catch (NumberFormatException ex) {
portnum = 1414; // set port to default value
}
// setup MQEnvironment
MQEnvironment.hostname = hostname;
MQEnvironment.channel = channel;
MQEnvironment.port = portnum;
// connect to Queue Manager
qMgr = new MQQueueManager(queueManagerName);
}
catch (MQException ex) {
System.out.println(″An MQ error occured : Completion code″ + ex.completionCode +
″ Reason code ″ + ex.reasonCode);
}
try {
int openOptions = MQC.MQOO_INPUT_AS_Q_DEF | MQC.MQOO_FAIL_IF_QUIESCING;
accessInputQueue = qMgr.accessQueue(queueName,openOptions);
}
catch (MQException ex){
System.out.println(″An MQ error occured : Completion code″
+ ex.completionCode + ″ Reason code ″ + ex.reasonCode);
}
try {
int openOptions = MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING;
accessOutputQueue = qMgr.accessQueue(queueName,openOptions);
}
catch (MQException ex){
System.out.println(″An MQ error occured : Completion code″
+ ex.completionCode + ″ Reason code ″ + ex.reasonCode);
}
176 Connecting to the Internet with MQSeries and VisualAge for Java
Notes:
1. First we create the string FormattedIMSData. Later we move into it the
message sent to IMS.
2. Then we convert all user input to uppercase.
3. We make sure that the input fields are 10 characters long, except the zip
code which is seven characters long. Longer fields are truncated,
shorter fields padded with blanks. This is required because the IMS
bridge expects the message in a particular format. Refer to 7.5, “The
IMS Bridge and the Application” on page 156.
4. Next, we move the fields into the string created earlier in the format that
the IMS Bridge expects. At the beginning is the transaction code IVTNO.
5. Then we create a new message object and write into the message
buffer LLZZ followed by the string FormattedIMSData. In this example,
we do not define an IMS header (IIH); the IMS Bridge will use the
default.
6. The message queue object is returned for processing by the
putMessage method.
String FormattedIMSData;
inputMsg.writeShort(59); // LL
inputMsg.writeByte(01); // ZZ
inputMsg.writeByte(01); // ZZ
inputMsg.writeString(FormattedIMSData);
}
catch (java.io.IOException ex) {
System.out.println(″An I/O error occurred while
writing message to the buffer: error code″ + ex);
}
178 Connecting to the Internet with MQSeries and VisualAge for Java
8.5.4 Put the IMS Message on the Queue
This method is executed after the message has been assembled by the
formatting method discussed above. As input, it receives the complete
message.
Important data in the message descriptor is the return address (queue and
queue manager name). The program returns the message ID that will be
used by the retrieveMessage method.
try {
// create new message object for getting message
MQMessage fromIMSMsg = new MQMessage();
180 Connecting to the Internet with MQSeries and VisualAge for Java
The format of the IMS message is:
Notes:
1. A string to hold the message from IMS is defined.
2. A new message object, fromIMSMsg, is created.
3. The message ID given by the putMessage method is stored as
correlation ID in the message header of the message object.
4. In the get message options, it is specified to wait up to 15 seconds for
the message to arrive. Data has to be converted by MQSeries.
5. The message is gotten from the queue and stored in the message object
fromIMSMsg.
6. The first four bytes are skipped, and the following 40 bytes are displayed
in the text area.
7. From the data IMS prepared, four fields are extracted and displayed in
the text fields.
8. If the reply from the host does not arrive in time, an error message is
displayed in the text area.
182 Connecting to the Internet with MQSeries and VisualAge for Java
public void start() {
closeOutputQueue();
closeInputQueue();
disconnectFromQmgr();
}
184 Connecting to the Internet with MQSeries and VisualAge for Java
8.6.2 Connect Input Data with Method
The formatToIMSmessage method takes five parameters as input. These
are last name, first name, extension, zip code and command. We build a
parameter-from-property connection between these fields and the
connection line we have just built.
• With the right mouse button, click on the dotted connection line between
the Submit button and the formatToIMSmessage method.
• Select Connect and then lastName from the menus.
• Drag the spider into the text field for the last name and drop it by
clicking the left mouse button.
• From the subsequent menu, select text. You should now see a purple
line going from the dotted Event-to-Method connection to the text field.
Repeat the above steps for the first name, extension and Zip code in order
to pass these parameters to formatToIMSmessage. Select from the Connect
pop-up either firstName, extension or zipCode.
To connect the command, select command from the Connect menu. In the
last step, choose selectedItem instead of text.
With these connections we are able to build the message. Your GUI should
now show the connections below.
The output of the putMessage method is the message ID. It is used by the
the retrieveMessage method to make sure that it gets the right reply
message off the queue. Thus, we create another connection from the
putMessage method to the retrieveMessage method.
• With the right mouse button click on the green line that represents the
method connection from formatToIMSmessage to putMessage. You built
this connection in the previous step.
• From the menus, select Connect and then normal result.
• Drop the spider again in the white area outside the dotted line border of
the applet.
• Select All Features from the menu.
• Select retrieveMessage from the methods list and click on OK.
186 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 119. WWW-IMS Example - Connecting Methods
The three arrows on the left side point to the following three methods (from
top to bottom):
1. formatToIMSmessage
2. putMessage
3. retrieveMessage
• With the right mouse button, click on the green line that you created
above, representing the method connection from putMessage to
retrieveMessage.
In the above step, we displayed the IMS return information in the Text Area.
Now display the last name, first name, extension and zip code in the
relevant Text fields. To do this, we make use of the getter methods we
created earlier (Figure 115 on page 183).
You might want to drag this connection to another area of the screen to get
it away from the other connections. You do this by selecting the connection,
holding down the mouse button, and dragging. This is purely cosmetic and
does not affect the functioning of the program.
• With the right mouse button, click on the getter method connection.
188 Connecting to the Internet with MQSeries and VisualAge for Java
• Choose Connect and normalResult.
• Drop the spider in the text field and select text from the menu.
Repeat the above steps to create connections for first name, extension and
zip code.
The seven arrows on the left in Figure 122 on page 190 point to the
following methods:
1. getLastName
2. getFirstName
3. getExtension
4. getZipCode
5. formatToIMSmessage
6. putMessage
7. retrieveMessage
Note: We have cleaned up some of the connections for clarity.
190 Connecting to the Internet with MQSeries and VisualAge for Java
8.7 Creating a Java Application Using VisualAge for Java
The Java application demonstrates how to implement the Java bindings
provided with MQSeries Version 5. You could write a Java application to
implement the business logic (middle tier) of a three-tier environment.
Typically, that would be a server program. In this example, we use the Java
application to take a request message from the client, log it to a file, and
then send it to IMS.
This is a very limited middle tier application, but it shows the use of the
bindings.
Now write the source code and create a constructor named public
BusinessLogic as shown in Figure 126 on page 193 through Figure 128 on
page 196.
192 Connecting to the Internet with MQSeries and VisualAge for Java
Figure 125. WWW-IMS Example - Import Bindings
import com.ibm.mqbind.*
import java.io.*
/**
* This class was generated by a SmartGuide.
*
*/
public class BusinessLogic {
private String qManager = ″MQNT1″ ; // define name of queue manager object
// to connect to.
// Specify the queue that we wish to open, and the open options
inputq.get(retrievedMessage, gmo);
194 Connecting to the Internet with MQSeries and VisualAge for Java
// Specify the queue that we wish to open for output, and the open options...
outputq.put(retrievedMessage,pmo);
System.out.println(″Successful put message.″ ) ;
inputq.close();
outputq.close();
qMgr.disconnect();
}
// If an error has occurred in the above, try to identify what went wrong.
// Was it an MQ error?
196 Connecting to the Internet with MQSeries and VisualAge for Java
Appendix A. MQSeries Objects for WWW/IMS Application
********************************************************************/
* Define one local queue for output from the java client. */
* This queue is only used in the java bindings example. */
********************************************************************/
DEFINE QLOCAL (′ toIMSqueue′) +
LIKE(SYSTEM.DEFAULT.LOCAL.QUEUE) +
DESCR(′ Queue used by Redbook example′ ) SHARE REPLACE
********************************************************************/
* Define one remote queue for output from the java client. */
* This queue is used in the example without the java bindings. */
********************************************************************/
DEFINE QREMOTE (′ toIMS′) +
LIKE(SYSTEM.DEFAULT.REMOTE.QUEUE) +
DESCR(′ Remote def used by Redbook example′) +
RNAME(′ IMS.SAMP.REQUEST′) +
RQMNAME(CSQ2) +
XMITQ(CSQ2) REPLACE
********************************************************************/
* Define one transmission queue used for communication with MVS */
* This queue is used in both examples. */
********************************************************************/
DEFINE QLOCAL (′ CSQ2′) +
LIKE(SYSTEM.DEFAULT.LOCAL.QUEUE) +
DESCR(′ Transmission queue for Redbook example to CSQ2 queue manager′) +
TRIGGER PROCESS(′ WTR05402.TO.CSQ2′) +
TRIGTYPE(FIRST) INITQ(SYSTEM.CHANNEL.INITQ) +
USAGE(XMITQ) +
REPLACE
********************************************************************/
* Define one process used to trigger channel. You do not need */
* this if you use MQSeries Version 5 */
********************************************************************/
DEFINE PROCESS(′ WTR05402.TO.CSQ2′) +
DESCR(′ Process used to trigger channel′) +
USERDATA(′ WTR05402.TO.CSQ2′) +
REPLACE
198 Connecting to the Internet with MQSeries and VisualAge for Java
********************************************************************/
* Define one sender channel to MVS system. */
********************************************************************/
DEFINE CHANNEL(′ WTR05402.TO.CSQ2′ ) CHLTYPE(SDR) +
DESCR(′ Channel from MQ on web server to MQ on MVS′) +
TRPTYPE(TCP) XMITQ(′ CSQ2′) +
CONNAME(9.24.104.74) REPLACE
********************************************************************/
* Define one receiver channel from MVS system. */
********************************************************************/
DEFINE CHANNEL(′ CSQ2.TO.WTR05402′ ) CHLTYPE(RCVR) +
DESCR(′ Channel from MQ on MVS to MQ on web server′) +
TRPTYPE(TCP) REPLACE
********************************************************************/
********************************************************************/
* Define a storage class for use by the IMS bridge. */
********************************************************************/
DEFINE STGCLASS(IMSBRDG) PSID(1) +
XCFGNAME(IMSBRDG) XCFMNAME(RAIIMS51)
********************************************************************/
* Define one local queue for input to the IMS Bridge. */
********************************************************************/
DEFINE QLOCAL (IMS.SAMP.REQUEST) +
DESCR(′ Queue used by Redbook example′) +
STGCLASS(IMSBRDG) NOTRIGGER SHARE REPLACE
200 Connecting to the Internet with MQSeries and VisualAge for Java
********************************************************************/
* Define one transmission queue used for commun. with Web Server.*/
********************************************************************/
DEFINE QLOCAL (′ WTR05402′) +
DESCR(′ Transmission queue for Redbook example to WTR05402 queue manager′) +
TRIGGER PROCESS(′ CSQ2.TO.WTR05402′) +
TRIGTYPE(F) INITQ(SYSTEM.CHANNEL.INITQ) +
USAGE(XMITQ) +
REPLACE
********************************************************************/
* Define one process used to trigger channel. */
********************************************************************/
DEFINE PROCESS(′ CSQ2.TO.WTR05402′) +
DESCR(′ Process used to trigger channel′) +
APPLICID(′ CSQX START′) +
USERDATA(′ CSQ2.TO.WTR05402′) +
REPLACE
********************************************************************/
* Define one sender channel to web server system. */
********************************************************************/
DEFINE CHANNEL(′ CSQ2.TO.WTR05402′ ) CHLTYPE(SDR) +
DESCR(′ Channel from MQ on MVS to MQ on web server′) +
TRPTYPE(TCP) XMITQ(′ WTR05402′) +
CONNAME(9.24.105.82)
********************************************************************/
* Define one receiver channel from web server system. */
********************************************************************/
DEFINE CHANNEL(′ CSQ2.TO.WTR05402′ ) CHLTYPE(RCVR) +
DESCR(′ Channel from MQ on web server to MQ on MVS′) +
TRPTYPE(TCP)
********************************************************************/
The diskette contains the examples developed in this book. Table 20 lists
the directories and the file names.
Note: The diskette can store only file names in 8.3 format. Make sure that
you change the file name when you copy the files onto your own system.
Licensees of this program who wish to have information about it for the
purpose of enabling: (i) the exchange of information between independently
created programs and other programs (including this one) and (ii) the
mutual use of the information which has been exchanged, should contact
IBM Corporation, Dept. 600A, Mail Drop 1329, Somers, NY 10589 USA.
The information contained in this document has not been submitted to any
formal IBM test and is distributed AS IS. The use of this information or the
implementation of any of these techniques is a customer responsibility and
depends on the customer′s ability to evaluate and integrate them into the
customer′s operational environment. While each item may have been
reviewed by IBM for accuracy in a specific situation, there is no guarantee
that the same or similar results will be obtained elsewhere. Customers
The following document contains examples of data and reports used in daily
business operations. To illustrate them as completely as possible, the
examples contain the names of individuals, companies, brands, and
products. All of these names are fictitious and any similarity to the names
and addresses used by an actual business enterprise is entirely
coincidental.
AIX CICS
DB2 IBM
IMS IMS/ESA
MQ MQSeries
MVS/ESA OS/2
OS/390 OS/400
PS/2 SupportPac
SystemView VisualAge
VTAM
Microsoft, Windows, Windows NT, and the Windows 95 logo are trademarks
or registered trademarks of Microsoft Corporation.
206 Connecting to the Internet with MQSeries and VisualAge for Java
Appendix D. Related Publications
The publications listed in this section are considered particularly suitable for
a more detailed discussion of the topics covered in this redbook.
208 Connecting to the Internet with MQSeries and VisualAge for Java
How to Get ITSO Redbooks
This section explains how both customers and IBM employees can find out about ITSO redbooks,
CD-ROMs, workshops, and residencies. A form for ordering books and CD-ROMs is also provided.
This information was current at the time of publication, but is continually subject to change. The
latest information may be found at http://www.redbooks.ibm.com.
IBMMAIL Internet
In United States: usib6fpl at ibmmail [email protected]
In Canada: caibmbkz at ibmmail [email protected]
Outside North America: dkibmbsh at ibmmail [email protected]
• Telephone orders
210 Connecting to the Internet with MQSeries and VisualAge for Java
IBM Redbook Order Form
Please send me the following:
Company
Address
We accept American Express, Diners, Eurocard, Master Card, and Visa. Payment by credit card not
available in all countries. Signature mandatory for credit card payment.
Application Programming Interface (API). An or the Intranet. Plain text (ASCII format) and
Application Programming Interface consists of binary files can be send.
the functions and variables that programmers
are allowed to use in their applications. encapsulation. Encapsulation is an
object-oriented programming technique that
applet. A Java program that runs within the makes an object′s data private or protected and
Web browser, providing executable content, but allows programmers to access and manipulate
having no access to the PC environment. the data only through method calls.
Applets can be embedded within existing HTML
documents and allows the user to interact with Firewall. A security scheme to protect one or
them. Applet can also run without a browser, more computer within the Internet from intrusion
you than have to use an applet viewer. by other external computer. A firewall is a
invisible boundary created by software.
application. A Java program that runs outside a Computer within a firewall can share resources
Web browser, having access to the entire PC and have access to other computer, which
environment. Applications commonly run from computer outside the firewall can′t. External
within a shell environment, or from the requests can be examined and filtered before
command line. they are allowed to go through the firewall and
than have also access to the resources within
asynchronous messaging. A method of the firewall.
communication between programs in which
programs place messages on message queues. host. A term referring to a computer (′of every
With asynchronous messaging, the sending size′) that is connected to the Internet or the
program proceeds with its own processing Intranet.
without waiting for a reply to its message.
HotJava. A Web browser developed by Sun
browser. A browser is a synonym of Web Microsystems, the first ′Java-enabled′ Web
browser or Client browser. It is a program with browser.
a graphical interface. Commonly used browsers
are: HTML. HTML (Hypertext Markup Language) is a
language used to define information that is to be
• IBM WebExplorer
displayed on the World Wide Web.
• MS Internet Explorer
instance. An instance is an object. When a
• Netscape Navigator
class is instantiated to produce an object, we
• Sun HotJava say that the object is an instance of the class.
class. A class is an encapsulated collection of Internet. The largest computer network of the
data, and methods to operat e on the data. A world. It is a network of networks (a network
class may be instantiated to produce an object can be a single computer) linked together to
that is an instance of the class. form a collective entity. They all communicate
via the TCP/IP protocol. Other names are:
client. In MQSeries, a client is a run-time Superhighway, Datahighway, The Net or
component that provides access t o queuing CyberSpace.
services on a server for local user applications.
interface. An interface is a special type of class
Email. Electronic mail (also e-mail) is a text which contains only abstract methods and no
message delivering method across the Internet instance variables. An interfaces provides a
message channel agent. A program that object. (1) In Java, an object is an instance of a
transmits messages from a transmission queue class. A class models a group of things; an
to a communication link, or from a object models a particular member of that
communication link to a destination queue. group.
(2) in MQSeries, an object is a queue manager,
message channel interface. The MQSeries a queue, or a channel.
interface to which application programs that
transmit messages between an MQSeries queue package. A package in Java is a way of giving
manager and another messaging system must a piece of Java code access to a specific set of
conform. A part of the MQSeries Framework. classes. Java code that is part of a particular
package has access to all the classes in the
message queue. Synonym for queue. package and to all non-private A private field is
not visible outside its own class .
message queue interface. The programming
interface provided by the MQSeries queue
214 Connecting to the Internet with MQSeries and VisualAge for Java
protected. A protected field is only visible subclass. A subclass is a class that extends
within its own class, within subclasses, or within another. The subclass inherits the protected
packages of which the class is a part. methods and variables of its superclass.
server. (1)In MQSeries a server is a queue Web. A short name for the World-Wide Web
manager that provides message queuing (WWW). You can think about the web as a
services to client applications running on a spider web, which connects thousands of
remote workstation. computer together.
(2) More generally a server is a program that
responds to requests for information in the Web browser. A program that formats and
particular two-program information flow model displays information that is distributed on the
of client/server. World Wide Web.
(3)The computer on which a server program
runs. Web server. A program that serves HTML
pages to the Web browser. See also Web
socket. A mechanism to allow processes to browser.
communicate with one other over the Internet.
They are the core functionality behind the World Wide Web (Web). The World Wide Web is
TCP/IP protocol. an Internet service, based on a common set of
protocols, which allows a particularly configured
server computer to distribute documents across
the Internet in a standard way.
Glossary 215
216 Connecting to the Internet with MQSeries and VisualAge for Java
List of Abbreviations
bindings 139
Special Characters example 141
<APPLET> 97 button category 104
bytecode 87, 89, 93
A
abbreviations 217 C
acronyms 217 channel 47, 54, 129, 143, 145
actionPerformed 108 how to start 61
add package to workspace 116 initiation queue 57
administrator ID 21 message channel 47
administrator password 21 MQI channel 47
alias queue 49 o v e r v i e w 57
align objects 107 process definition 57
AMQSCOMA.TST 50 transport types
AMQSGET 63 MQWin 47
example 63 triggering 62
AMQSGETC 67 channel initiator 56, 57, 61
AMQSPUT 63 channel name 143
example 63 channel pair 57, 59
AMQSPUTC 67 class (Java) 94
API 43 class library 88
example code 73 classes 90
list of all 72 CLASSPATH 16, 26, 37, 93
applet 89 Windows NT 29
height 97 client 54, 55
test 110 client connection
vie w 97 client/server
width 97 connection 64
applet class directory 36 fat client 54
applet vs application 92 slim client 54
application solutions 3
triggering 62 start connection 67
application vs applet 92 test connection 67
assure delivery 3 test connection (IVP) 145
asynchronous messaging 44 clients and servers 54
awt 95 close queue 133
AWT enhancements 91 connections 134
example 134
method 133, 134
B com.ibm.mq 139
beans 101 com.ibm.mqbind 139
bibliography 207
220 Connecting to the Internet with MQSeries and VisualAge for Java
extends 96 import package 115
IMS adapter 152
IMS Bridge 149, 151
F basic flow 154
fat client 54 implicit MQI support 152
fonts 106 message structure 156
front page 22 setup 153
index.html 34, 35
InfoZip 34
G UNZ520X2 34
get message 137 unzip 34
connections 137 infrastructure 3
method 138 initiation queue 49
global communication 3 inner classes 92
glossary 213 installation 13
graphics 96 Internet Connection Secure Server 14
GUI 90, 103 JDK 1.1.4 26
guided tour 80 MQFirst 78
MQSeries Client for Java
client code 36
H documentation 34
height of applet 97
MQSeries V5 29
Hello World applet 95
Netscape Navigator 23
Hello World application 94
verification 37
hostname 20, 21, 129, 145
VisualAge for Java 38
Hotjava 31
internationalization 91
how MQSeries works 55
Internet applications 11
How to get
Internet Connection Server
ICSS 14
administration page 23
JDK 27
download 14
MQFirst 78
front page 22
MQSeries Client for Java 33
installation 17
Netscape 24
Internet connections 6
VisualAge for Java 38
Internet Gateway 7
HTML
interpreter 92
call applet 97
java 94
directory 19
ivj.dat 40
HTTP port 20
IVP 37
I J
IDE.icx 40
JAR file format 91
im p ort
Java
mq classes 41, 139
a first try 93
mqbind classes 41, 139
basics 87
mqservices 41
classes 90
compiler 94
Index 221
Java (continued)
interpreter 92, 94 M
o v e r v i e w 87 MA83 files 34
packages 90 MA83.ZIP 34
platform independence 87 main 94
sample applet 95 manipulate MQM objects 52
sample application 94 match height 107
versus C 88 math package 91
virtual machine 93 message 44
Java client 66 descriptor 44
Java command 143 layout (IMS) 157
Java database connectivity 92 sequence number 50
Java native interface 92 structure for IMS 156
java.applet.class 90 types 44
java.awt.class 90 message channel 47, 55
JAVA.EXE 92 message channel agent 57
java.io.class 90 message channel agent (MCA) 56
java.lang.class 90 message driven 75
java.net.class 90 message queues 48
java.util.class 90 message queuing 44
javac 94 message too large 50
JAVAPM.EXE 92 messaging 44
JDBC 92 messaging and queuing 44
JDK 36 method
download 27 close queue 133, 134
installation 26, 28 connect to queue manager 129
jdk114.exe 27 disconnect 130
get message 138
open queue 132
K put message 135
key ring file 20 server
connect to queue manager 141
method invocation (remote) 91
L middleware 43
leaf node 54, 55 model category 104
left-justify 107 MQBACK 73
links to Java SDK 34 MQBEGIN 73
listener 56, 66, 70 mqbind 139
how to start 60, 61 mqc4jdoc.zip 34
in MQSeries system 57 MQCLOSE 73
what it does 62 MQCMIT 73
local queue 48, 143 MQCONN 72
low cost 3 MQCONNX 72
MQDISC 73
MQEnvironment 129
MQException 129
222 Connecting to the Internet with MQSeries and VisualAge for Java
MQFirst MQSeries V5
guided tour 80 Bindings for Java 30
installation 78 Client for Java 30
quick start 85 database coordination 30
mqfirst.zip 78 description 1
MQGET 57, 72 distribution lists 30
MQI 43, 46, 55 fast channels 30
MQI calls 72 improved MQSC utility 30
examples 73 installation 31
MQI channel 47, 55 Internet Gateway 30
MQIIH 156 languages 31
MQINQ 73 major new functions 2
M Q M 43, 45 message groups 30
MQOPEN 73 message segmentation 30
MQPUT 56, 72 select components 33
MQPUT1 73 select destination directory 32
MQQueue object 132 SPX support 30
MQSeries 43 What′s new 29
API 43 MQSERVER 66
at runtime 43 mqservices 41
channels 54 MQSET 73
client 55
concepts 77
configuration 77 N
how it works 55 n32e301p.exe 24
IMS Bridge 151 NetBIOS 47
installation 29 Netscape Navigator 23
objects 46 download 24
OTMA support 151 install 24
o v e r v i e w 43 install window 25
port 1414 57 setup for Java 25
principle 45 network computer 89
queue manager 45 network preferences 25
se rve r 55 non-persistent message 44
Web page 33 non-visual bean 104
MQSeries Client for Java 31, 33 NT Service 18
advantages 3 NT421EPE_ENU.EXE 14
documentation 34, 35 NTFS 15, 39
how to get it 33
modes 36
appletviewer 37 O
Web browser 36 object properties 104
positioning 3 object serialization 91
recommendation 31 object-oriented 90
required JDK 31 objective 5
support pack MA83 33 objects
required 59
Index 223
objects (MQM) 46 queue (continued)
open queue 131 r e m o t e 48
connections 132 reply-to 49
method 132 transmission 48
OTMA 149 queue manager 45, 48, 145
OTMA client 149 connect 128
overview create 50
channels 57 default 50
IMS Bridge 149 disconnect 130
Java 87 functions 46
MQSeries 43 object manipulation 52
VisualAge for Java 87 objects 46
queuing 44
queuing system 55
P quick start (MQFirst) 85
package 101 quick start (VisualAge) 100
paint 96
persistent message 44
platform independence 87 R
port 66, 67, 129, 145 receiveMessage
port 1080 26 example 138
port 1414 57 reflection 91
println 94 remote method invocation 91
PrintStream 94 remote queue 48, 57, 59
process definition 48 what is it 58
program-to-program communication 45 reply message 44
project 101, 140 reply-to queue 49
proxy 25, 26 report message 44
public 94 repository 116
put message 134 request message 44
connections 136 resize 96
method 135 resize objects 107
putMessage return codes 73
example 135 robustness 89
RPC 46
RUNMQCHI 61
Q RUNMQLSR 60, 66
queue 47 RUNMQSC 46, 60
alias 49 example 53
close 133 interactive 52
dead-letter 50
define 52
dynamic 49 S
initiation 49 sample program
local 48 Hello World applet 95
example 53 Hello World application 94
open 131 VisualAge for Java 119
224 Connecting to the Internet with MQSeries and VisualAge for Java
sample programs trigger message 70
MQSeries APIs 73 trigger monitor 56, 57, 70
scenarios 3 trigger type 61
security 89, 91 triggering 62, 68
security preferences 26 tst files 142
se rve r 54, 55
server application 140
s er v er connection 65 U
how to test 67, 145 uni-directional 58
MQSeries client for Java 145 unit of work 73
triggering 62, 68 UNZ520X2 34
signed applets 91 unzip 34
slim client 54 URL
SNA LU 6.2 47 for Internet Connection Family 14
socks server 25, 26 for JDK 26
SPX 47 for MQSeries Client for Java 33
SSL port 20 for Netscape 24
start for server 21
applet 97 for support packs 33
channel 57, 60, 61 JDK 27
channel initiator 61 MQFirst 78
communication 60 MQSeries V5 3
ICSS 21 VisualAge for Java 38
IMS application 152
listener 61
MQFirst 79 V
server program 143 variable 106
VisualAge for Java 100 verify installation 37
static 94 versioning 113
Sun Java Development Kit 27 view applet 97
SupportPac MA83 33 Visual Age for Java
SupportPacs link 33 start 41
SVRCONN 65 visual programming 108
synchronous messaging 44 VisualAge
syncpoint 73 project 140
VisualAge for Java 38
a first try 100
T disk space requirements: 39
TCP/IP 47, 88 entry version 38
test application 142 example 119
test button 110 hardware requirements 38
test connection 63, 146 installation 38, 40
text field 103 o v e r v i e w 4, 87
time independent 75 setup 40
transmission queue 48, 57 uninstall beta 39
trigger 152 VTAM 149
channel program 61
Index 225
W
wEnty100.zip. 38
width of applet 97
workbench 101
workspace
add package 116
writeUTF() 135
X
XCF 149
XCF group 149
xmit queue 48, 57, 58
226 Connecting to the Internet with MQSeries and VisualAge for Java
ITSO Redbook Evaluation
Connecting the Enterprise to the Internet with MQSeries and VisualAge for Java
SG24-2144-00
Your feedback is very important to help us maintain the quality of ITSO redbooks. Please complete
this questionnaire and return it using one of the following methods:
• Use the online evaluation form found at http://www.redbooks.com
• Fax this form to: USA International Access Code + 1 914 432 8264
• Send your comments in an Internet note to [email protected]
Please rate your overall satisfaction with this book using the scale:
(1 = very good, 2 = good, 3 = average, 4 = poor, 5 = very poor)
Was this redbook published in time for your needs? Yes____ No____
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
_____________________________________________________________________________________________________
Printed in U.S.A.
SG24-2144-00