BEA Logo BEA MessageQ Release 5.0

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   MessageQ Doc Home   |   MVS Client User's Guide   |   Previous Topic   |   Next Topic   |   Contents   |   Index

Configuring the BEA MessageQ MVS Client

 

This chapter describes how to configure the BEA MessageQ MVS Client. It includes the following topics:

Verifying Your Installation

Before you configure your MVS Client, make sure that the BEA MessageQ MVS Client software is properly installed and operational on your system. Refer to the BEA MessageQ MVS Client Installation Guide for MVS Client installation information.

After successful installation of the BEA MessageQ MVS Client, files provided on the distribution CD-ROM are installed in six partitioned datasets created on your MVS system. The files in the datasets are described in Table 2-1.

Table 2-1 MVS Client Datasets

Install CD /MVS5_0 root

MVS Partitioned Datasets

Dataset Description

./CNTL

DMQ.V5R0.CNTL

BEA MessageQ JCL library

./H

DMQ.V5R0.H

BEA MessageQ C include files

./X

DMQ.V5R0.X

BEA MessageQ sample C program source files

./COB

DMQ.V5R0.COB

BEA MessageQ COBOL Copy Books and sample programs

./LIB

DMQ.V5R0.LIB

BEA MessageQ object library for Language Environment Batch and CICS, Version 4.1

./PROC

DMQ.V5R0.PROC

BEA MessageQ example programs

An FTP directory listing on the system that was used to install the MVS Client should match the listing shown in Listing 2-1.

Listing 2-1 FTP Listing of the MVS Client Datasets


FTP> cd 'dmq.v5r0'
250 "'DMQ.V5R0.'" is working directory name prefix
FTP> dir
200 Port request OK.
125 List started OK.
Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
TSO001 3380 1998/11/19 1 10 FB 80 6160 PO CNTL
TSO001 3380 1998/11/19 1 10 FB 80 6160 PO COB
TSO001 3380 1998/11/19 1 10 VB 259 3200 PO H
TSO001 3380 1998/11/19 1 100 FB 80 6160 PO LIB
TSO001 3380 1998/11/19 1 200 FB 80 3200 PO PROC
TSO001 3380 1998/11/19 1 20 VB 259 3200 PO X

250 List completed successfully.
FTP>


Note: We recommend making the BEA MessageQ MVS Client files read only. Be careful not to modify the original set of datasets that you copied to your system during installation. When following the configuration instructions provided in the rest of this chapter, modify only your own copy of the datasets. In addition, perform all compiling and linking of applications using BEA MessageQ in the user's area, not in the installation area.

Creating MVS Client Datasets

The BEA MessageQ MVS Client provides an object library (DMQ.V5R0.LIB) to support BEA MessageQ enabled applications. In addition, the media includes the following JCL procedures in the partitioned dataset DMQ.V5R0.CNTL (which are templates to be used in configuring and building your BEA MessageQ applications with the MVS Client):

Required Datasets

You must create the following four datasets for the application that uses the BEA MessageQ MVS Client:

These datasets are used to convey information to and from the BEA MessageQ MVS Client on behalf of your application. At run time, these files are associated with your job by JCL DDnames (as described in Table 2-2).

To create these four datasets, use the JCL templates provided during the installation (in DMQ.V5R0.CNTL), replacing the necessary volume and high-level qualifier (HLQ). In addition, you need to make specific configuration changes to the DMQCONF procedure (which creates the DMQINI dataset) as described in the sections following Table 2-3. After you have made these edits to the JCL files, submit these four MVS batch jobs (DMQCONF, DMQELOG, DMQLOG, DMQJRNL) to create the associated datasets.

Refer to Table 2-2 for further information about how to create the datasets required to run BEA MessageQ MVS Client applications.

Table 2-2 Creating MVS Client Datasets

Dataset

Description

Client Configuration File

This file contains all of the information needed to configure BEA MessageQ on the MVS Client.

Required MVS DDname:

DMQINI

Default dataset name:

DMQ.V5R0.INI

JCL for creating dataset:

DMQCONF in the dataset DMQ.V5R0.CNTL

Modifications needed to JCL:

Modify the JCL to create a specific dataset name for the configuration file by replacing all instances of DMQ.V5R0.INI in the JCL along with VOLUMES and TSOUSR and recompile.

Client Log File

This file contains log messages about BEA MessageQ events.

Required MVS DDname:

DMQELOG

Default dataset name:

DMQ.V5R0.ELOG

JCL for creating dataset:

DMQELOG in the dataset DMQ.V5R0.CNTL

Modifications needed to JCL:

Modify the JCL to create a specific dataset name for the error log file for each application by replacing all instances of DMQ.V5R0.ELOG in the JCL along with VOLUMES and TSOUSR and recompile.

Client Message Tracing File

This file contains messages that were sent to or received by the MVS Client application.

Required MVS DDname:

DMQLOG

Default dataset name:

DMQ.V5R0.LOG

JCL for creating dataset:

DMQLOG in the dataset DMQ.V5R0.CNTL

Modifications needed to JCL

Modify the JCL to create a specific dataset name for the message tracing file used for each application by replacing all instances of DMQ.V5R0.LOG in the JCL along with VOLUMES and TSOUSR and recompile.

Store and Forward Journal File

This file contains all of the recoverable messages that could not be delivered to the Client Library Server process in the BEA MessageQ Server group.

Required MVS DDname:

DMQSAF

Default dataset name:

DMQ.V5R0.SAF

JCL for creating dataset:

DMQJRNL in the dataset DMQ.V5R0.CNTL

Modifications needed to JCL:

Modify the JCL to create a specific dataset name for the SAF journal file for each application by replacing all instances of DMQ.V5R0.SAF in the JCL along with VOLUMES and TSOUSR and rebuild.

Table 2-3 describes the configuration options for the MVS Client.

Table 2-3 BEA MessageQ MVS Client Configuration Options

Option

Description

Required?

Server

Default Server-Network transport, server host name, and endpoint definition

Yes

Failover

Automatic Failover Server-Network transport, server host name, and endpoint definition for the failover server

No

Logging

Settings for logging error events and tracing messages to the Event Temporary Storage Queue (TSQ) or to a log file

No

MRS

Settings for enabling the local store-and-forward (SAF) message journal and configuring the local journal files

No

Tracing

Settings to enable run-time trace information about the API calls and client library activity

No

To configure the BEA MessageQ MVS Client, use the MVS Client Configuration JCL, DMQCONF as shown in Listing 2-2. A copy of this JCL is located in DMQ.V5R0.CNTL. The configuration file is a VSAM ESDS. Edit the JCL file to add the appropriate settings and job card; then submit the job for processing.

Update and run this JCL whenever changes to the definitions of any of the following system configuration elements are needed.

Configuring the Server Connection

This section describes how to configure the connection to the BEA MessageQ Client Library Server (CLS) on the BEA MessageQ message server system. Configuration of the server connection consists of the following two items:

Configuring the Default Server

The default server identifies the BEA MessageQ server system for all connections to the message queuing bus. If you enable automatic reconnect, applications that are attempting to connect to a server (or lose a connection to the CLS), try to reconnect when the network connection to the server is available. Client applications also reconnect in the event that the CLS or host server system is stopped and restarted.

During an automatic reconnect event, the BEA MessageQ MVS Client attempts to connect only to the default server. Automatic reconnect does not attempt to use the failover server.

After a successful reconnect, the application is automatically attached to the message queuing bus and messaging operations can continue without interruption. All pending messages in the SAF journal are sent to the CLS before new operations can be performed. For example, when a pams_get_msg operation triggers the reconnect threshold and a successful automatic reconnect and attach operation completes, the SAF journal is completely drained before the pams_get_msg function call returns. Table 2-4 shows the default server configuration options.

Table 2-4 Configuring the Default Server

Option

Description

TransportType

The network-level transport used to send messages to the BEA MessageQ CLS. The MVS Client supports TCP/IP only.

Hostname

The name of the host running the BEA MessageQ CLS. The Hostname must have a corresponding entry in the local hosts file.

Endpoint

The endpoint used by the BEA MessageQ CLS. For more information about specifying the endpoint, see the CLS section of the Installation and Configuration Guide for your server platform.

ReconnectMsgInterval

The number of message operations that occur before the server attempts to reconnect. If set to 0, automatic reconnect is not enabled. If set to greater than 0, automatic reconnect is enabled.

The BEA MessageQ MVS attempts to reconnect to the server using the ReconnectMsgInterval option as the threshold for making a new connection attempt. Any messaging operation call, such as pams_attach_q, pams_put_msg, or pams_get_msg, increments the count used to determine when to attempt another reconnect. When the number of operations attempted reaches the ReconnectMsgInterval threshold, a reconnect attempt is made. Applications can choose to use a higher reconnect value to stream pams_put_msg requests into the local journal for forwarding at a later time.

Configuring the Automatic Failover Server

If the primary (default) server is not available and you have enabled automatic failover, the BEA MessageQ MVS Client provides the option of connecting to a failover CLS. The failover options are ignored if automatic reconnect to the default server is enabled.

When you enable automatic failover, an MVS Client will transparently try to attach to the failover server when the CLS on the primary server group is not available. Attempts to connect to the failover server are made only during a call to pams_attach_q.

Using the failover capability requires additional planning and work in order for messages to be sent and received correctly. The message queues used by BEA MessageQ MVS Client applications are implemented by the BEA MessageQ server group. The message queues, and any recoverable message journals, are located on the server system.

When connecting to the failover group, the queue address used by the MVS Client is likely to change (unless the BEA MessageQ group started on the failover system has the same group ID as the primary server group). Recoverable messages sent to the client using the queue address of the primary server group are not delivered to the client when it reattaches to the failover server in a different BEA MessageQ server group.

The simplest use of automatic failover is when MVS Client applications attach to a temporary queue and use a request/response style of messaging. These applications send requests to one or more servers that return responses to the queue address that sent the request. If failover occurs, the MVS Client application is automatically reattached to a new temporary queue and request messages are sent and responses delivered to the new queue address. The application is unaware that a failover event occurred, except that any pending response is not received.

Automatic failover is not appropriate for all applications. When client applications attach to a specific permanent queue and receive recoverable messages sent to that queue address, they depend on the message queuing resources of that BEA MessageQ group. Recoverable messages sent to the queue address while the client application is not attached are saved on that system. If the client reconnects to the same queue name or number, but in a different (failover) BEA MessageQ group, the recoverable messages in the BEA MessageQ group where the default CLS is located are not delivered to the new queue address used by the MVS Client.

On the other hand, the previous scenario could use failover by making the BEA MessageQ server group (and all disk-based queuing resources) also failover to another system so that messages previously sent to the MVS Client are received after a failover transition. Table 2-5 describes the automatic failover server configuration options.

Table 2-5 Configuring the Automatic Failover Server

Option

Description

EnableAutomatic-Failover

If set to "1", automatic failover is enabled. The failover server is used when the default server is not available and automatic failover is enabled. The Reconnect Message Interval option (see Table 2-4) must be greater than 0.

TransportType

The network-level transport used to send messages to the failover server. The MVS Client supports TCP/IP only.

Hostname

The name of the host running the BEA MessageQ CLS. The Hostname must have a corresponding entry in the local hosts file.

Endpoint

The endpoint used by the BEA MessageQ CLS. For more information, see the startup information for the CLS in the BEA MessageQ Installation and Configuration Guide for your server platform.

Configuring Logging

The MVS Client logging feature enables developers to:

Table 2-6 describes the logging configuration options. Note that you must perform a pams_attach_q operation for any of the "Log Messages" options to take effect.

Table 2-6 Configuring Logging

Option

Description

ErrorEvents

If set to "1", logs error events to the DD statement DMQELOG. The default behavior is to log error events.

If error event logging is enabled, when errors to the CLS occur, the DD name of the configuration file used at the time of the connection attempt is also logged.

In MVS batch applications, error messages are also written to the DD statement (SYSOUT) of the executing application.

SentCICSMessages

If set to "1", sends a copy of BEA MessageQ messages sent by the CICS DMQTLOG Temporary Storage Queue (TSQ). (CICS only)

SentMessages

If set to "1", sends a copy of BEA MessageQ messages sent by the application to the DD statement DMQLOG message log file. In MVS batch applications, messages are also sent to the DD statement SYSOUT. When running under CICS, the messages are sent to the DMQLOG defined by the File Control Table (FCT).

ReceivedCICSMessages

If set to "1", sends a copy of BEA MessageQ messages received by the application to the CICS DMQTLOG Temporary Storage Queue. (CICS only)

ReceivedMessages

If set to "1", sends a copy of BEA MessageQ messages received by the application to the DD statement DMQLOG message log file. In MVS batch applications, messages are also sent to the DD statement SYSOUT. When running under CICS, the messages are sent to the DMQLOG defined by the File Control Table (FCT).

To perform error logging, an error log file must be created. To create an error log file, modify the DMQELOG JCL statement code that is illustrated in Listing 2-3 (supplied with the MVS Client) and submit the job for processing. The error log file must be VSAM ESDS. The template JCL is contained in DMQ.V5R0.CNTL as member DMQELOG. A DD card for DMQELOG must be included in your BEA MessageQ application execution JCL.

Listing 2-3 DMQELOG JCL Code


//******************************************                
//ALLOC EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DMQ.V5R0.ELOG)
DEFINE CLUSTER( -
NAME(DMQ.V5R0.ELOG) -
VOLUMES(TSOUSR) -
RECORD(132 132) -
NONINDEXED -
RECORDSIZE(132 132) -
NONSPANNED -
SHAREOPTIONS(2 3) -
FREESPACE (20 0) -
CISZ(1024) -
SPEED -
) -
DATA(NAME(DMQ.V5R0.ELOG.DATA))
/*
//*
//ALLOCP EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//*
//OUTFILE DD DSN=DMQ.V5R0.ELOG,DISP=SHR
//INFILE DD *
DMQ ERROR LOG
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(OUTFILE)
//*
//ST1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN DD DSN=DMQ.V5R0.ELOG,DISP=SHR
//SYSIN DD *
PRINT -
CHAR -
INFILE(IN)
/*
//


To perform message logging, a log file must be created. To create a log file, modify the DMQLOG JCL statement that is illustrated in Listing 2-4 (supplied with the MVS Client) and submit the job for processing. The log file must be a VSAM ESDS. The template JCL is contained in DMQ.V5R0.CNTL as member DMQLOG. A DD card for the DMQLOG must be included in your BEA MessageQ application execution JCL.

Listing 2-4 DMQLOG JCL Code


//******************************************                
//ALLOC EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DMQ.V5R0.LOG)
DEFINE CLUSTER( -
NAME(DMQ.V5R0.LOG) -
VOLUMES(TSOUSR) -
RECORD(1000 500) -
NONINDEXED -
RECORDSIZE(132 400) -
NONSPANNED -
SHAREOPTIONS(2 3) -
FREESPACE (20 0) -
CISZ(1024) -
SPEED -
) -
DATA(NAME(DMQ.V5R0.LOG.DATA))
/*
//*
//ALLOCP EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//*
//OUTFILE DD DSN=DMQ.V5R0.LOG,DISP=SHR
//INFILE DD *
DMQ LOG
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(OUTFILE)
//*
//ST1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN DD DSN=DMQ.V5R0.LOG,DISP=SHR
//SYSIN DD *
PRINT -
CHAR -
INFILE(IN)
/*
//


Configuring Message Recovery Services

Message Recovery Services (MRS) are the BEA MessageQ services that manage the automatic redelivery of critical messages. Messages that are sent using a recoverable delivery mode are written to the local store-and-forward (SAF) journal when the connection to the server system is not available.

The BEA MessageQ Client ensures delivery of recoverable messages to the CLS on the BEA MessageQ Server by providing a store-and-forward (SAF) journal to store recoverable messages when the connection to a CLS is not available. Local SAF journal processing is available when Message Recovery Services (MRS) are enabled in the BEA MessageQ Client configuration.

When message recovery is enabled, messages sent using the following reliable delivery modes are saved to the store and forward file:

When the connection to the CLS is re-established, all messages in the SAF journal are sent before new messages are processed. The SAF messages are transmitted in first-in/first-out (FIFO) order. When the connection to the CLS is reestablished, a return status of PAMS__LINK_UP is used to indicate that journal processing is no longer active.

Messages are sent from the SAF when one of the following events occurs:

The MRS section of the initialization file is optional if recoverable messaging is not used. See Listing 2-5 for the MRS configuration options.

Listing 2-5 MRS Configuration Options


(MRS)                                                           
Enabled=0
JournalPath=./
JournalFileSize=0
JournalCycle=0
JournalSizeFixed=0
PreAllocate=1
JournalBlockSize=0


When the MRS Enabled field is set to zero, MRS is disabled. If the Enabled field is set to "1", message recovery services are enabled. The BEA MessageQ MVS Client uses a store and forward (SAF) file to store messages that cannot be delivered because a connection to the message queuing server is not available. When the connection to the server is restored, messages are delivered from the SAF file first; then normal messaging communication is restored.

If message recovery services are enabled in the initialization file, an SAF file must be created. An SAF file is a VSAM Key Sequenced Data Set (KSDS). The JCL to create this file is located in DMQ.V5R0.CNTL, as member DMQJRNL. A DD card for DMQSAF must be included in the BEA MessageQ application execution JCL.

To create an SAF file, modify the DMQJRNL JCL job statements illustrated in Listing 2-6 (supplied with the MVS Client) and submit the job for processing. The template JCL is contained in the DMQ.V5R0.CNTL as member DMQJRNL.

Listing 2-6 Create SAF File


//******************************************                    
//ALLOC EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE (DMQ.V5R0.SAF)
DEFINE CLUSTER( -
NAME(DMQ.V5R0.SAF) -
VOLUMES(TSOUSR) -
RECORD(500 100) -
INDEXED KEY(4 0) -
RECORDSIZE(2048 32000) -
UNIQUE NONSPANNED -
SHAREOPTIONS(2 3) -
FREESPACE (20 0) -
CISZ(32000) -
SPEED -
) -
DATA(NAME(DMQ.V5R0.SAF.DATA)) -
INDEX(NAME(DMQ.V5R0.SAF.INDEX))
/*
//*
//ALLOCP EXEC PGM=IDCAMS
//*
//SYSPRINT DD SYSOUT=*
//*
//OUTFILE DD DSN=DMQ.V5R0.SAF,DISP=SHR
//INFILE DD *
0000000000000000000000000000000000000000DMQCL SAF V1.0
//SYSIN DD *
REPRO INFILE(INFILE) OUTFILE(OUTFILE)
//*
//ST1 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//IN DD DSN=DMQ.V5R0.SAF,DISP=SHR
//SYSIN DD *
PRINT -
CHAR -
INFILE(IN)
/*
//


Configuring Tracing

Tracing can be a useful debugging tool, because it allows you to enable and disable BEA MessageQ MVS Client application processing activity trace output. The trace output may create large SYSOUT files on your system, and should be used only to monitor specific application behavior. Table 2-7 shows the tracing configuration options.

Table 2-7 Configuring Tracing

Option

Description

PamsTrace

If set to "1", logs the API calls to the file DMQLOG. The default is no tracing. On MVS batch, the messages are also directed to the SYSPRINT DD statement in the execution JCL.

DmqclTrace

If set to "1", traces the internal client library activity to the file DMQLOG. On MVS batch, the messages are also directed to the SYSPRINT DD statement in the execution JCL.

Verifying the Configuration

After you have successfully configured the BEA MessageQ MVS Client, you should have four VSAM datasets in the user area: INI, LOG, ELOG, and SAF. These datasets are referenced by the JCL that will run the BEA MessageQ application. An FTP directory listing from the system that was used to install the MVS Client should match the following listing.

Listing 2-7 FTP Listing of the MVS Client Configuration Datasets


FTP> dir
200 Port request OK.
125 List started OK.
Volume Unit Referred Ext Used Recfm Lrecl BlkSz Dsorg Dsname
TSO001 3380 VSAM DMQ.ELOG
TSO001 3380 VSAM DMQ.ELOG.DATA
TSO001 3380 VSAM DMQ.INI
TSO001 3380 VSAM DMQ.INI.DATA
TSO001 3380 VSAM DMQ.LOG
TSO001 3380 VSAM DMQ.LOG.DATA
TSO001 3380 VSAM DMQ.SAF
TSO001 3380 VSAM DMQ.SAF.DATA
TSO001 3380 VSAM DMQ.SAF.INDEX

250 List completed successfully.
FTP>


Testing the Configuration

The MVS Client media contains sample programs to test your configuration. The sample programs are located in the DMQ.V5R0.PROC dataset. The C source code is located in the DMQ.V5R0.X dataset. The JCL to compile all of the sample C programs is member DMQC370 in dataset DMQ.V5R0.CNTL. The JCL to linkedit all the sample C programs is member DMQLINK in dataset DMQ.V5R0.CNTL. DMQLINK requires a preallocated dataset for the linkage editor to store the executable programs. Please consult your systems programmer for the optimum block size for your disk configuration. The default name used by the supplied JCL procedures is DMQ.V5R0.LINKLIB. DMQRUN is located in DMQ.V5R0.CNTL. This JCL procedure executes the sample programs. Listing 2-8 lists the DMQRUN JCL.

Listing 2-8 The DMQRUN JCL File


//DMQRUN      JOB ,DMQ,CLASS=A,
// MSGCLASS=X,MSGLEVEL=(1,1)
// TIME=(5,00)
//******************************************
//RUNIT EXEC PGM=X@GET
//STEPLIB DD DSN=DMQ.V5R0.PROC,DISP=SHR
// DD DSN=CEE.V1R5M0.SCEERUN,DISP=SHR
//*
//DMQINI DD DSN=DMQ.V5R0.INI,DISP=SHR
//DMQELOG DD DSN=DMQ.V5R0.ELOG,DISP=SHR
//DMQLOG DD DSN=DMQ.V5R0.LOG,DISP=SHR
//DMQSAF DD DSN=DMQ.V5R0.SAF,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD *
//SYSTCPD DD DISP=SHR,DSN=TCPIP.DATA


The X@GET example shown in Listing 2-8 attaches to a temporary queue on the server node, sends ten messages to itself, and receives them based on selection criteria. In addition, it sends ten more messages and receives them based on their priority setting. The C source statements for X@GET are located in DMQ.V5R0.X.

To run an MVS Client program, you must have a BEA MessageQ group, including a CLS running on a server system. No special group or queue definitions are required. Listing 2-9 shows the output of the X@GET sample program.

Listing 2-9 X@GET Program Output


X@Get Select Example starting...
Attached to queue: `20, 1'
Putting messages:
Put Message:
Text: `first message'
Class: FIRST
Type: ODD
Getting FIRST messages
Got message:
Class: FIRST
Type: ODD
Exited from MessageQ.
Pams_Get_msg Example complete....