MQ Administration
MQ Administration
System Administration
V5.1
SC34-5558-00
MQSeries® for AS/400® IBM
System Administration
V5.1
SC34-5558-00
Note!
Before using this information and the product it supports, be sure to read the general information under “Appendix C.
Notices” on page 119.
Contents v
vi MQSeries for AS/400, V5.1 System Administration
Figures
1. Create MQM Queue initial panel . . . . . 17 8. Sequence of events when updating MQM
2. Work with MQM Queues panel . . . . . . 17 objects . . . . . . . . . . . . . . 75
3. Extract from the MQSC command file, 9. MQSeries for AS/400 journaling . . . . . 79
myprog.in . . . . . . . . . . . . . 30 10. Extract from an MQSeries error log . . . . 96
4. Display MQM Command Server panel 35 11. FFST report . . . . . . . . . . . . 98
5. An example rule from a DLQ handler rules 12. Example of an MQSeries configuration file 109
table . . . . . . . . . . . . . . . 59 13. Example queue manager configuration file 110
6. Understanding instrumentation events . . . 68
7. Monitoring queue managers across different
platforms, on a single node . . . . . . . 69
This book describes the system administration aspects of MQSeries for AS/400,
V5.1, and the services provided to support commercial messaging. This includes
managing the queues that applications use to receive their messages, and ensuring
that applications have access to the queues that they require.
For a summary of the new function introduced in MQSeries for AS/400, V5.1, see
the MQSeries for AS/400, V5.1 Quick Beginnings book.
Time-independent applications
With message queuing, the exchange of messages between the sending and
receiving programs is independent of time. This means that the sending and
receiving application programs are decoupled so that the sender can continue
processing without having to wait for the receiver to acknowledge receipt of the
message. In fact, the target application does not even have to be running when the
message is sent. It can retrieve the message after it is has been started.
Message-driven processing
Upon arrival on a queue, messages can automatically start an application using a
mechanism known as triggering. If necessary, the applications can be stopped
when the message (or messages) have been processed.
What is a message?
A message is a string of bytes that is meaningful to the applications that use it.
Messages are used for transferring information from one application program to
another (or to different parts of the same application). The applications can be
running on the same platform, or on different platforms.
Message lengths
The maximum length a message can be is 100 MB (where 1 MB equals 1 048 576
bytes). In practice, the message length may be limited by:
v The maximum message length defined for the receiving queue
v The maximum message length defined for the queue manager
v The maximum message length defined by either the sending or receiving
application
v The amount of storage available for the message
It may take several messages to send all the information that an application
requires.
What is a queue?
A queue is a data structure used to store messages. The messages may be put on
the queue by application programs, or by a queue manager as part of its normal
operation.
Each queue is owned by a queue manager. The queue manager is responsible for
maintaining the queues it owns and for storing all the messages it receives onto
the appropriate queues.
The maximum size of a queue is 2 GB. For information about planning the
amount of storage you require for queues, see the MQSeries Planning Guide or visit
the following web site for platform-specific performance reports:
http://www.software.ibm.com/ts/mqseries/txppacs/txpm1.html
For more information about MQI calls, see the MQSeries Application Programming
Reference manual.
The MQGET request from the application determines the method used.
Objects
Many of the tasks described in this book involve manipulating MQSeries objects.
In MQSeries Version 5.1, the object types include queue managers, queues, process
definitions, channels, clusters, and namelists.
Each instance of a queue manager is known by its name. This name must be
unique within the network of interconnected queue managers, so that one queue
manager can unambiguously identify the target queue manager to which any
given message should be sent.
For the other types of object, each object has a name associated with it and can be
referenced by that name. These names must be unique within one queue manager
and object type. For example, you can have a queue and a process with the same
name, but you cannot have two queues with the same name.
Managing objects
You can manage objects using the native AS/400 menus.
For more information about these methods, see “Chapter 3. Alternative methods
for MQSeries administration” on page 29.
You can also administer MQSeries for AS/400 from a Windows NT machine using
the MQSeries Explorer (see “Using the MQSeries Explorer” on page 32).
Object attributes
The properties of an object are defined by its attributes. Some you can specify,
others you can only view. For example, the maximum message length that a queue
can accommodate is defined by its MaxMsgLength attribute; you can specify this
attribute when you create a queue. The DefinitionType attribute specifies how the
queue was created; you can only display this attribute.
The formal name of an attribute is its PCF name. Because using the CL interface is
an important part of this book, you are more likely to see the CL name in
examples than the PCF name of a given attribute.
Each queue belongs to a single queue manager and is said to be a local queue to
that queue manager.
A remote queue manager is any queue manager other than the local queue manager.
A remote queue manager may exist on a remote machine across the network, or
may exist on the same machine as the local queue manager.
MQSeries for AS/400, V5.1 supports multiple queue managers on the same
machine.
A queue manager object may be used in some MQI calls. For example, you can
inquire about the attributes of the queue manager object using the MQI call
MQINQ.
Note: You cannot put messages on a queue manager object; messages are always
put on queue objects, not on queue manager objects.
MQSeries queues
Queues are defined to MQSeries using:
v The native AS/400 CRTMQMQ CL command
v The appropriate MQSC DEFINE command
v The PCF Create Queue command
Note: The MQSeries process, channel, and namelist objects can be defined in a
similar manner.
The commands specify the type of queue and its attributes. For example, a local
queue object has attributes that specify what happens when applications reference
that queue in MQI calls. Examples of attributes are:
v Whether applications can retrieve messages from the queue (GET enabled).
v Whether applications can put messages on the queue (PUT enabled).
v Whether access to the queue is exclusive to one application or shared between
applications.
v The maximum number of messages that can be stored on the queue at the same
time (maximum queue depth).
v The maximum length of messages that can be put on the queue.
For further details about defining queue objects, see the MQSeries Command
Reference manual or the MQSeries Programmable System Management manual.
Process definitions
A process definition object defines an application that is to be started in response to a
trigger event on an MQSeries queue manager. See the “Initiation queues” entry
under “Specific local queue types and their uses” on page 6 for more information.
The process definition attributes include the application ID, the application type,
and data specific to the application.
Use the MQSeries for AS/400 CRTMQMPRC CL command, the MQSC command
DEFINE PROCESS, or the PCF command Create Process to create a process
definition.
Channels
Channels are objects that provide a communication path from one queue manager
to another. Channels are used in distributed message queuing to move messages
from one queue manager to another. They shield applications from the underlying
communications protocols. The queue managers may exist on the same, or
different, platforms. For queue managers to communicate with one another, you
must define one channel object at the queue manager that is to send messages, and
another, complementary one, at the queue manager that is to receive them.
Use the MQSeries for AS/400 CRTMQMCHL CL command, the MQSC command
DEFINE CHANNEL, or the PCF command Create Channel to create a channel
definition.
For information on channels and how to use them, see the MQSeries
Intercommunication manual.
Clusters
In a traditional MQSeries network using distributed queuing, every queue
manager is independent. If one queue manager needs to send messages to another
A cluster is a group of queue managers set up in such a way that the queue
managers can communicate directly with one another over a single network,
without the need for complex transmission queue, channels, and queue definitions.
For information about clusters, see the MQSeries Queue Manager Clusters book.
Namelists
A namelist is an MQSeries object that contains a list of other MQSeries objects.
Typically, namelists are used by applications such as trigger monitors, where they
are used to identify a group of queues. The advantage of using a namelist is that it
is maintained independently of applications; that is, it can be updated without
stopping any of the applications that use it. Also, if one application fails, the
namelist is not affected and other applications can continue using it.
Namelists are also used with queue manager clusters so that you can maintain a
list of clusters referenced by more than one MQSeries object.
Use the MQSeries for AS/400 CRTMQMNL CL command, the MQSC command
DEFINE NAMELIST, or the PCF command Create Namelist to create a namelist
definition.
Default object names have the stem SYSTEM.DEF; for example, the default local
queue is SYSTEM.DEFAULT.LOCAL.QUEUE, and the default receiver channel is
SYSTEM.DEF.RECEIVER. You cannot rename these objects; default objects of these
names are required.
When you define an object, any attributes that you do not specify explicitly are
copied from the appropriate default object. For example, if you define a local
queue, those attributes you do not specify are taken from the default queue
SYSTEM.DEFAULT.LOCAL.QUEUE.
An MQI server is a queue manager that provides queuing services to one or more
clients. All the MQSeries objects, for example queues, exist only on the queue
For more information about creating channels for clients and servers, see the
MQSeries Intercommunication book.
For information about client support in general, see the MQSeries Clients book.
You must link your applications to the appropriate client libraries. See the
MQSeries Clients book for further information.
User exits
User exits provide a mechanism for you to insert your own code into a queue
manager function. The user exits supported include:
v Channel exits These exits change the way that channels operate. Channel exits
are described in the MQSeries Intercommunication book
v Data conversion exits These exits create source code fragments that can be put
into application programs to convert data from one format to another. Data
conversion exits are described in the MQSeries Application Programming Guide.
v The cluster workload exit The function performed by this exit is defined by the
provider of the exit. Call definition information is given in the MQSeries Queue
Manager Clusters book. The exit is supported in the following environments: AIX,
AS/400, HP-UX, OS/2, Sun Solaris, Windows NT, and OS/390.
Security
In MQSeries for AS/400, V5.1 security is provided by the Object Authority
Manager (OAM) component. See “Chapter 5. Protecting MQSeries objects” on
page 43 for details of this component.
Transactional support
An application program can group a set of updates into a unit of work. These
updates are usually logically related and must all be successful for data integrity to
be preserved. If one update succeeded while another failed then data integrity
would be lost.
A local unit of work is one in which the only resources updated are those of the
MQSeries queue manager. Here, syncpoint coordination is provided by the queue
manager itself using a dual-phase commit process and use of the new MQI calls,
MQBACK and MQCMIT.
MQSeries for AS/400 is not XA-compliant but is able to support and participate in
global units of work coordinated by the AS/400 COMMIT and ROLLBACK
commands.
MQSeries applications
When you create or customize MQSeries applications, it is useful to keep a record
of all MQSeries definitions created. This record can be used for:
v Recovery purposes
v Maintenance
v Rolling out MQSeries applications
Note: One queue manager must be selected as the default queue manager.
3. Start a local queue manager by issuing the STRMQM command from an
AS/400 command line.
You can stop a queue manager by issuing the ENDMQM command from the
AS/400 command line, and control a queue manager by issuing other MQSeries
commands from an AS/400 command line.
Remote queue managers cannot be started remotely but must be created and
started in their systems by local operators. An exception to this is where remote
operating facilities (outside MQSeries for AS/400) exist to enable such operations.
There are two online methods to create MQSeries objects, which are:
1. Using a Create command:
CRTMQMCHL
Create MQM Channel
CRTMQMNL
Create MQM Namelist
CRTMQMPRC
Create MQM Process
CRTMQMQ
Create MQM Queue
2. Using the appropriate Work with MQM object command:
WRKMQMCHL
Work with MQM Channels
WRKMQMNL
Work with MQM Namelists
WRKMQMPRC
Work with MQM Processes
Note: All MQM commands can be submitted from the ‘Message Queue Manager
Commands’ menu. To display this menu, type GO CMDMQM on the command
line, and press the Enter key.
The system displays the prompt panel automatically when you select a
command from this menu. To display the prompt panel for a command that
you have typed directly on the command line, press F4 before pressing the
Enter key.
Bottom
Parameters for options 2, 3, 5, 14, 15, 16 or command
===> ________________________________________________________________________
F3=Exit F4=Prompt F5=Refresh F6=Create F9=Retrieve F12=Cancel
F16=Repeat position to F17=Position to F20=Right F21=Print
4. Press F6 to create a new queue; this takes you to the CRTMQMQ panel. See
“Creating a local queue using the CRTMQMQ command” on page 16 for
instructions on how to create the queue.
This section describes how to define a remote queue for each of the three uses.
Each message channel has a transmission queue name specified at the sending end
of the message channel.
Note: If you use clusters, you do not have to create a transmission queue.
Applications can put messages directly on a message queue, or they can be put
there indirectly, for example, through a remote queue definition.
For more information about triggering, see the MQSeries Application Programming
Guide.
Model queues and local queues have the same set of attributes, except that on
model queues you can specify whether the dynamic queues created are temporary
or permanent. (Permanent queues are maintained across queue manager restarts,
temporary ones are not.)
This command changes the dead-letter queue used, and enables inhibit events.
Notes:
1. USAGE *NORMAL indicates that this queue is not a transmission queue.
2. If you already have a local queue on the same queue manager with the name
orange.local.queue, this command fails. Use the REPLACE *YES attribute, if
you want to overwrite the existing definition of a queue, but see also
“Changing local queue attributes” on page 22.
MQSeries provides a dead-letter queue handler that allows you to specify how
messages found on a dead-letter queue are to be processed or removed. For further
information, see “Chapter 6. The MQSeries dead-letter queue handler” on page 57.
This command creates a queue with the same attributes as our original queue
orange.local.queue, rather than those of the system default local queue.
You can also use the CPYMQMQ command to copy a queue definition, but
substituting one or more changes to the attributes of the original. For example:
CPYMQMQ FROMQ('orange.local.queue') TOQ('third.queue') MAXMSGLEN(1024)
This command copies the attributes of the queue orange.local.queue to the queue
third.queue, but specifies that the maximum message length on the new queue is
to be 1024 bytes, rather than 2000.
Note: When you use the CPYMQMQ command, you are copying the queue
attributes only. You are not copying the messages on the queue.
This command changes a single attribute, that of the maximum message length;
all the other attributes remain the same.
v Using the CRTMQMQ command with the REPLACE *YES option, for example:
CRTMQMQ QNAME('orange.local.queue') QTYPE(*LCL) MAXMSGLEN(10000) REPLACE(*YES)
This command changes not only the maximum message length, but all the other
attributes, which are given their default values. The queue is now put enabled
whereas previously it was put inhibited. Put enabled is the default, as specified
by the queue SYSTEM.DEFAULT.LOCAL.QUEUE, unless you have changed it.
When an application specifies an alias queue in an MQI call, the queue manager
resolves the real queue name at run time.
For example, an application has been developed to put messages on a queue called
my.alias.queue. It specifies the name of this queue when it makes an MQOPEN
request and, indirectly, if it puts a message on this queue. The application is not
aware that the queue is an alias queue. For each MQI call using this alias, the
queue manager resolves the real queue name, which could be either a local queue
or a remote queue defined at this queue manager.
By changing the value of the TGTQNAME attribute, you can redirect MQI calls to
another queue, possibly on another queue manager. This is useful for maintenance,
migration, and load-balancing.
This command redirects MQI calls that specify my.alias.queue to the queue
yellow.queue. The command does not create the target queue; the MQI calls fail if
the queue yellow.queue does not exist at run time.
If you change the alias definition, you can redirect the MQI calls to another queue.
For example:
CHGMQMQ QNAME('my.alias.queue') TGTQNAME('magenta.queue')
You can also use alias queues to make a single queue (the target queue) appear to
have different attributes for different applications. You do this by defining two
aliases, one for each application. Suppose there are two applications:
v Application ALPHA can put messages on yellow.queue, but is not allowed to get
messages from it.
v Application BETA can get messages from yellow.queue, but is not allowed to put
messages on it.
You can do this using the following commands:
ALPHA uses the queue name alphas.alias.queue in its MQI calls; BETA uses the
queue name betas.alias.queue. They both access the same queue, but in different
ways.
You can use the REPLACE *YES attribute when you define queue aliases, in the
same way that you use these attributes with local queues.
This command creates a model queue definition. From the DFNTYPE attribute, the
actual queues created from this template are permanent dynamic queues.
Note: The attributes not specified are automatically copied from the
SYSYTEM.DEFAULT.MODEL.QUEUE default queue.
You can use the REPLACE *YES attribute when you define model queues, in the
same way that you use them with local queues.
DSPMQMQ QNAME('green.model.queue')
/* ALTER the model queue to enable puts on any */
/* dynamic queue created from this model. */
This section describes how to set up the required objects to support triggering on
MQSeries.
In this example, a trigger event is to be generated when there are 100 messages of
priority 5 or greater on the local queue motor.insurance.queue, as follows:
CRTMQMQ QNAME('motor.insurance.queue') QTYPE(*LCL)
PRCNAME('motor.insurance.quote.process') MAXMSGLEN(2000)
DFTMSGPST(*YES) INITQNAME('motor.ins.init.queue')
TRGENBL(*YES) TRGTYPE(*DEPTH) TRGDEPTH(100) TRGMSGPTY(5)
where:
QNAME('motor.insurance.queue')
Specifies the name of the application queue being defined.
PRCNAME('motor.insurance.quote.process')
Specifies the name of the application to be started by a trigger monitor
program.
MAXMSGLEN(2000)
Specifies the maximum length of messages on the queue.
DFTMSGPST(*YES)
Specifies that messages on this queue are persistent by default.
INITQNAME('motor.ins.init.queue')
Is the name of the initiation queue on which the queue manager is to put
the trigger message.
TRGENBL(*YES)
Is the trigger attribute value.
TRGTYPE(*DEPTH)
Specifies that a trigger event is generated when the number of messages of
the required priority (TRGMSGPTY) reaches the number specified in
TRGDEPTH.
Where:
PRCNAME('motor.insurance.quote.process')
Is the name of the process definition.
TEXT('Insurance request message processing')
Is a description of the application program to which this definition relates.
This text is displayed when you use the DSPMQMPRC command. This can
help you to identify what the process does. If you use spaces in the string,
you must enclose the string in single quotation marks.
APPTYPE(*OS400)
Is the type of application to be started.
APPID(MQTEST/TESTPROG)
Is the name of the application executable file, specified as a fully qualified
file name.
USRDATA('open, close, 235')
Is user-defined data, which can be used by the application.
You can also use the CHGMQMPRC command to alter an existing process
definition, and the DLTMQMPRC command to delete a process definition.
The systems are called SYSTEMA and SYSTEMB, and the communications protocol
used is TCP/IP.
The channel should go to RUNNING status and the messages will be sent to
queue TARGETB on SYSTEMB.
This chapter gives an overview of the various methods, and includes the following
topics:
v “Local and remote administration”
v “Performing administrative tasks using MQSC commands” on page 30
v “Performing administrative tasks using PCF commands” on page 30
v “Using the MQSeries Explorer” on page 32
v “Managing the command server for remote administration” on page 34
.
.
DEFINE QLOCAL(ORANGE.LOCAL.QUEUE) REPLACE +
DESCR(' ') +
PUT(ENABLED) +
DEFPRTY(0) +
DEFPSIST(NO) +
GET(ENABLED) +
MAXDEPTH(5000) +
MAXMSGL(1024) +
DEFSOPT(SHARED) +
NOHARDENBO +
USAGE(NORMAL) +
NOTRIGGER;
.
.
For portability among MQSeries environments, you are recommended to limit the
line length in MQSC command files to 72 characters. The plus sign indicates that
the command is continued on the next line.
Object attributes specified in MQSC are shown in this book in uppercase (for
example, RQMNAME), although they are not case sensitive.
Notes:
1. The format of an MQSC file does not depend on its location in the file system
2. MQSC attribute names are limited to eight characters.
3. MQSC commands are available on other platforms, including OS/390.
Therefore, you can write a program to issue PCF commands to any queue manager
in the network from a single node. In this way, you can both centralize and
automate administration tasks.
Each PCF command is a data structure that is embedded in the application data
part of an MQSeries message. Each command is sent to the target queue manager
using the MQI function MQPUT in the same way as any other message. The
command server on the queue manager receiving the message interprets it as a
command message and runs the command. To get the replies, the application
issues an MQGET call and the reply data is returned in another data structure. The
application can then process the reply and act accordingly.
Note: Unlike MQSC commands, PCF commands and their replies are not in a text
format that you can read.
Briefly, these are some of the things the application programmer must specify to
create a PCF command message:
Message descriptor
This is a standard MQSeries message descriptor, in which:
Message type (MsqType) is MQMT_REQUEST.
Message format (Format) is MQFMT_ADMIN.
Application data
Contains the PCF message including the PCF header, in which:
The PCF message type (Type) specifies MQCFT_COMMAND.
The command identifier specifies the command, for example, Change
Queue (MQCMD_CHANGE_Q).
For a complete description of the PCF data structures and how to implement them,
see the MQSeries Programmable System Management manual.
Object attributes in PCF, which are not limited to eight characters, are shown in
this book in italics. For example, the PCF equivalent of RQMNAME is
RemoteQMgrName.
Escape PCFs
Escape PCFs are PCF commands that contain MQSC commands within the
message text. You can use PCFs to send commands to a remote queue manager.
For more information about using escape PCFs, see the MQSeries Programmable
System Management manual.
After you have created and populated your data bag, you can then send an
administration command message to the command server of a queue manager,
using the mqExecute call, which will wait for any response messages. The
mqExecute call handles the exchange with the command server and returns
responses in a response bag.
For more information about using the MQAI, see the MQSeries Administration
Interface Programming Guide and Reference book.
For more information about PCFs in general, see the MQSeries Programmable System
Management manual.
The platforms and levels of MQSeries which can be administered using the
MQSeries Explorer are described in “Prerequisite software” on page 33.
You can invoke the MQSeries Explorer from the First Steps application, or from the
Windows NT Start prompt.
Prerequisite software
Before you can use the MQSeries Explorer, you must have the following installed
on your Windows NT computer:
v The Microsoft Management Console Version 1.1 or higher (installed as part of
MQSeries for Windows NT 5.1 installation)
v Internet Explorer Version 4.01 (SP1) (installed as part of MQSeries for Windows
NT 5.1 installation)
The MQSeries Explorer can connect to remote queue managers using the TCP/IP
communication protocol only.
The MQSeries Explorer handles the differences in the capabilities between the
different command levels and platforms. However, if it encounters a value which it
does not recognize as an attribute for an object, you won’t be able to change the
value of that attribute.
A command server is mandatory for all administration involving PCFs, the MQAI,
and also for remote administration.
Note: For remote administration, you must ensure that the target queue manager
is running. Otherwise, the messages containing commands cannot leave the
queue manager from which they are issued. Instead, these messages are
queued in the local transmission queue that serves the remote queue
manager. This situation should be avoided, if at all possible.
There are separate control commands for starting and stopping the command
server. Users can perform the operations described in the following sections using
the MQSeries Services snap-in.
where saturn.queue.manager is the queue manager for which the command server
is being started.
To display the status of the command server for a queue manager, called here
saturn.queue.manager, the CL command is:
DSPMQMCSVR('saturn.queue.manager')
You must issue this command on the target machine. If the command server is
running, the panel shown in Figure 4 on page 35 appears:
Note: Stopping a queue manager also ends the command server associated with it
(if one has been started).
Warning to users
You are strongly recommended not to alter MQSeries work management
objects unless you fully understand the concepts of OS/400 and MQSeries
work management.
Internal MQSeries jobs use threads – do not change any parameters in the
objects described in this chapter.
Before reading this chapter you should familiarize yourself with the concepts of
work management on the AS/400. You are recommended to look at the OS/400
Work Management manual, paying particular attention to the sections on “Job
Starting and Routing” and “Batch Jobs”.
Work Management refers to the process of tailoring MQSeries tasks to obtain the
optimum performance from your system, or to make administration simpler.
Sample job descriptions are provided for two of the MQSeries batch jobs. If no
specific job description is provided for an MQSeries job it runs with the default job
description QMQMJOBD.
The work management objects that are supplied when you install MQSeries are
listed in Table 2.
Table 2. Work management objects
Name Type Description
QMQM *SBSD The subsystem in which all MQSeries jobs run.
QMQM *JOBQ The job queue attached to the supplied subsystem
QMQMMSG *MSGQ The default message queue for MQSeries jobs.
QMQMRUN20 *CLS A class description for high priority MQSeries jobs
QMQMRUN35 *CLS A class description for medium priority MQSeries jobs
QMQMRUN50 *CLS A class description for low priority MQSeries jobs
AMQZLAA0 *JOBD The job description that is used by the MQSeries agent processes
AMQZXMA0 *JOBD The job description that is used by MQSeries execution controllers
QMQMJOBD *JOBD The default MQSeries job description - used if there is not a specific
job description for a job
The job description used to start the job controls many attributes of the job. For
example:
v The job queue on which the job will be queued and, therefore, on which
subsystem the job will run.
v The routing data used to start the job and, therefore, the class that the job uses
for its run-time parameters.
v The output queue that the job will use for print files.
Note: If MQSeries jobs do not appear to be starting, make sure that the subsystem
is running and the job queue is not held,
Note: The QMQMJOBD job description will always be used for MQSeries jobs
that do not have their own job description.
2. The job description uses the MQSeries default job queue so the job is submitted
to job queue QMQM/QMQM.
3. The routing data on the QMQMJOBD job description is QMQMRUN35, so the
machine searches the subsystem routing entries for one that matches that data.
By default, the routing entry with sequence number 9910 has comparison data
that matches QMQMRUN35, so the job will be started with the class defined on
that routing entry, which is also called QMQMRUN35.
4. The QMQM/QMQMRUN35 class has run priority set to 35, so the
AMQALMPX job runs in subsystem QMQM with a lower priority than most
interactive jobs on the system, but higher priority than most batch jobs.
The following examples show how you can change and create MQSeries job
descriptions to change the run-time attributes of MQSeries jobs.
The key to the flexibility of MQSeries Work Management lies in the two—tier way
that MQSeries searches for job descriptions:
v If you create or change job descriptions in a queue manager library, those
changes will override the global job descriptions in QMQM but the changes will
be local and affect that particular queue manager alone.
v If you create or change global job descriptions in the QMQM library, those job
descriptions will affect all queue managers on the system, unless overridden
locally for individual queue managers.
Configuration examples
1. The following example increases the priority of channel control jobs for an
individual queue manager.
To make the repository manager and channel initiator jobs, AMQRRMFA and
RUNMQCHI respectively, run as quickly as possible for queue manager
TESTQM, carry out the following steps:
a. Create local duplicates of the QMQM/QMQMJOBD job description with the
names of the MQSeries processes that you want to control in the queue
manager library. For example,
CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM)
NEWOBJ(RUNMQCHI)
CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM)
NEWOBJ(AMQRRMFA)
b. Change the routing data parameter on the job description to ensure that the
jobs will use the QMQMRUN20 class.
CHGJOBD JOBD(QMTESTQM/RUNMQCHI) RTGDTA('QMQMRUN20')
CHGJOBD JOBD(QMTESTQM/AMQRRMFA) RTGDTA('QMQMRUN20')
The AMQRRMFA and RUNMQCHI jobs for queue manager TESTQM will now:
v Use the new local job descriptions in the queue manager library
v Run with priority 20, because the QMQMRUN20 class will be used when the
jobs enter the subsystem.
2. The following example runs a queue manager in its own subsystem
To make all the jobs for queue manager TESTQM run in the QBATCH
subsystem , carry out the following steps:
a. Create a local duplicate of the QMQM/QMQMJOBD job description in the
queue manager library with the command:
CRTDUPOBJ OBJ(QMQMJOBD) FROMLIB(QMQM) OBJTYPE(*JOBD) TOLIB(QMTESTQM2)
b. Change the job queue parameter on the job description to ensure that the
jobs use the QBATCH job queue:
CHGJOBD JOBD(QMTESTQM2/QMQMJOBD) JOBQ(*LIBL/QBATCH)
To ensure that jobs are routed and prioritized correctly you can either:
All MQSeries AMQALMPX jobs, for all queue managers, will use the new
global AMQALMPX job description, providing that there are no local
overriding job descriptions in the local queue manager library.
All job log spool files for these jobs will now be written to output queue
CHKPTLOGS in library MYLIB.
Security considerations
You need to consider the following points when setting up authorities to the users
in your enterprise:
1. You should grant and revoke authorities to the MQSeries for AS/400
commands using the AS/400 GRTOBJAUT and RVKOBJAUT commands.
2. During installation of MQSeries for AS/400 the following special user profiles
are created:
QMQM
Is used primarily for internal product-only functions. However, it can
be used to write trusted applications using
MQCNO_FASTPATH_BINDINGS; see the MQSeries Application
Programming Guide for further information.
QMQMADM
Is intended to be used as a group profile for administrators of
MQSeries. The group profile gives access to CL commands and
MQSeries resources.
NOBODY
Is intended for internal product-only features.
3. If you are sending channel commands to remote queue managers, you must
ensure that your user profile is a member of the group QMQMADM on the
target system. For a list of PCF and MQSC channel commands, see “Channel
command security” on page 55.
4. It is not essential for your user profile to belong to group QMQMADM to issue:
v PCF commands, including Escape PCFs, from an administration program
v MQI calls from an application program.
5. The group set associated with a user is cached when the group authorizations
are computed by the OAM.
Any changes made to a user’s group memberships after the group set has
been cached are not recognized until the queue manager is restarted.
6. You should limit the number of users who have authority to work with
commands that are particularly sensitive. These commands include:
v Create Message Queue Manager (CRTMQM)
v Delete Message Queue Manager (DLTMQM)
v Start Message Queue Manager (STRMQM)
v End Message Queue Manager (ENDMQM)
v Start Command Server (STRMQMCSVR)
v End Command Server (ENDMQMCSVR)
v Trace MQSeries (TRCMQM)
7. Channel definitions contain a security exit program specification. Channel
creation and modification requires special considerations. Details of security,
concerning exits, are given in the MQSeries Intercommunication book.
Different groups of users may be granted different kinds of access authority to the
same object. For example, for a specific queue, one group may be allowed to
perform both put and get operations; another group may be allowed only to
browse the queue (MQGET with browse option). Similarly, some groups may have
get and put authority to a queue, but are not allowed to alter or delete the queue.
MQSeries for AS/400 provides commands to grant, revoke, and display the
authority that an application, or user, has to do the following:
v Issue MQSeries for AS/400 commands
v Perform operations on MQSeries for AS/400 objects
MQSeries authorities
Access to MQSeries objects is controlled by authorities to:
1. Issue the MQSeries command
2. Access the MQSeries objects referenced by the command
By authorizing *PUBLIC to an object, or set of objects, all users of the system gain
that authority.
Access authorizations
Authorizations defined by the AUT keyword on the GRTMQMAUT and
RVKMQMAUT commands can be categorized as follows:
v Authorizations related to MQI calls
v Authorization-related administration commands
v Context authorizations
v General authorizations, that is, for MQI calls, for commands, or both
The following tables list the different authorities, using the AUT parameter for
MQI calls, Context calls, MQSC and PCF commands, and generic operations.
Table 3. Authorizations for MQI calls
AUT Description
*ALTUSR Allows another user’s authority to be used for MQOPEN and
MQPUT1 calls.
*BROWSE Retrieve a message from a queue by issuing an MQGET call with the
BROWSE option.
*CONNECT Connect the application to the specified queue manager by issuing
an MQCONN call.
*GET Retrieve a message from a queue by issuing an MQGET call.
*INQ Make an inquiry on a specific queue by issuing an MQINQ call.
*PUT Put a message on a specific queue by issuing an MQPUT call.
*SET Set attributes on a queue from the MQI by issuing an MQSET call. If
you open a queue for multiple options, you have to be authorized
for each of them.
In this example:
v RED.LOCAL.QUEUE is the object name.
v *LCLQ (local queue) is the object type.
v GROUPA is the name of a user profile on the system whose authorizations are
to change. This could be, but does not have to be, used as a group profile for
other users.
v *BROWSE and *PUT are the authorizations being granted to the specified queue.
*BROWSE adds authorization to browse messages on the queue (to issue
MQGET with the browse option).
*PUT adds authorization to put (MQPUT) messages on the queue.
v saturn.queue.manager is the queue manager name.
2. The following command grants to users JACK and JILL all applicable
authorizations, to all process definitions, for the default queue manager.
GRTMQMAUT OBJ(*ALL) OBJTYPE(*PRC) USER(JACK JILL) AUT(*ALL)
3. The following command grants user GEORGE authority to put a message on the
queue ORDERS, on the queue manager TRENT.
GRTMQMAUT OBJ(TRENT) OBJTYPE(*MQM) USER(GEORGE) AUT(*CONNECT) MQMNAME (TRENT)
GRTMQMAUT OBJ(ORDERS) OBJTYPE(*Q) USER(GEORGE) AUT(*PUT) MQMNAME (TRENT)
Authority to get messages from any queue, whose name starts with the characters
PAY, owned by queue manager PAYROLLQM is removed from all users of the system
unless they, or a group to which they belong, have been separately authorized.
In this §, the information is presented as a set of tables that specify the following:
Action to be performed
MQI option, MQSC command, or PCF command.
Access control object
Queue, process, or queue manager.
Authorization required
Expressed as an ‘MQZAO_’ constant.
MQI authorizations
An application is allowed to issue specific MQI calls and options only if the user
identifier under which it is running (or whose authorizations it is able to assume)
has been granted the relevant authorization.
For MQOPEN and MQPUT1, the authority check is made on the name of the
object being opened, and not on the name, or names, resulting after a name has
been resolved. For example, an application may be granted authority to open an
alias queue without having authority to open the base queue to which the alias
resolves. The rule is that the check is carried out on the first definition encountered
during the process of name resolution that is not a queue-manager alias, unless the
queue-manager alias definition is opened directly; that is, its name appears in the
ObjectName field of the object descriptor. Authority is always needed for the
particular object being opened; in some cases additional queue-independent
authority—which is obtained through an authorization for the queue-manager
object—is required.
General notes:
1. The special authorization MQZAO_ALL_MQI includes all of the following that
are relevant to the object type:
v MQZAO_CONNECT
v MQZAO_INQUIRE
Administration authorizations
These authorizations allow a user to issue administration commands. This can be
an MQSC command as an escape PCF message or as a PCF command itself. These
methods allow a program to send an administration command as a message to a
queue manager, for execution on behalf of that user.
General notes:
1. To perform any PCF command, you must have DISPLAY authority on the
queue manager.
Note: If you open a queue for multiple options, you have to be authorized for
each of them.
Queues
The authority to a dynamic queue is based on, but is not necessarily the same as,
that of the model queue from which it is derived.
For alias queues and remote queues, the authorization is that of the object itself,
not the queue to which the alias or remote queue resolves. It is, therefore, possible
to authorize a user profile to access an alias queue that resolves to a local queue to
which the user profile has no access permissions.
You should limit the authority to create queues to privileged users. If you do not,
users may bypass the normal access control simply by creating an alias.
For example:
v A server program running under user profile PAYSERV retrieves a request
message from a queue that was put on the queue by user profile USER1.
v When the server program gets the request message, it processes the request and
puts the reply back into the reply-to queue specified with the request message.
v Instead of using its own user profile (PAYSERV) to authorize opening the
reply-to queue, the server can specify some other user profile – in this case,
USER1. In this example, you can use alternate-user authority to control whether
PAYSERV is allowed to specify USER1 as an alternate-user profile when it opens
the reply-to queue.
Note: You can use alternate-user profiles on any MQSeries object. Use of an
alternate-user profile does not affect the user profile used by any other
resource managers.
Context authority
Context is information that applies to a particular message and is contained in the
message descriptor, MQMD, which is part of the message.
For descriptions of the message descriptor fields relating to context, see the
MQSeries Application Programming Reference manual.
For information about the context options, see the MQSeries Application
Programming Guide.
For more information about remote security, see the MQSeries Intercommunication
book.
PCF commands
You can issue PCF channel commands by sending a PCF message to the
SYSTEM.ADMIN.COMMAND.QUEUE on a remote MQSeries system. The user
profile, as specified in the message descriptor of the PCF message, must have the
appropriate authorizations in the relevant group on the target system.
On MQSeries for AS/400 V5.1 the actual group is QMQMADM, and on UNIX systems
the name of the group is mqm.
See the MQSeries Programmable System Management manual for the PCF security
requirements.
For MQSC commands issued from the STRMQMMQSC command, the user
profile in the PCF message is normally that of the current user.
Queue managers, message channel agents, and applications can put messages on
the DLQ. All messages on the DLQ should be prefixed with a dead-letter header
structure, MQDLH. Messages put on the DLQ by a queue manager or by a
message channel agent always have an MQDLH. You are strongly recommended to
supply an MQDLH to applications putting messages on the DLQ. The Reason field
of the MQDLH structure contains a reason code that identifies why the message is
on the DLQ.
INPUTQ(ABC1.DEAD.LETTER.QUEUE)
If you do not specify the DLQ or the queue manager as shown above, the default
queue manager for the installation is used along with the DLQ belonging to that
queue manager.
The STRMQMDLQ command takes its input from the rules table.
You must be authorized to access both the DLQ itself, and any message queues to
which messages on the DLQ are forwarded, in order to run the DLQ handler.
Furthermore, you must be authorized to assume the identity of other users, if the
DLQ handler is to be able to put messages on queues with the authority of the
user ID in the message context.
1. It is often preferable to avoid placing messages on a DLQ. For information about the use and avoidance of DLQs, see the
MQSeries Application Programming Guide.
Control data
This section describes the keywords that you can include in a control-data entry in
a DLQ handler rules table. Please note the following:
v The default value for a keyword, if any, is underlined.
v The vertical line (|) separates alternatives. You can specify only one of these.
v All keywords are optional.
INPUTQ (QueueName|' ')
This parameter allows you to name the DLQ you want to process:
1. If you specify an UDLMSGQ value (or *DFT) as a parameter to the
STRMQMDLQ command, this overrides any INPUTQ value in the rules
table.
2. If you specify a blank UDLMSGQ value as a parameter to the
STRMQMDLQ command, the INPUTQ value in the rules table is used.
3. If you specify a blank UDLMSGQ value as a parameter to the
STRMQMDLQ command, and a blank INPUTQ value in the rules table, the
system default dead-letter queue is used.
INPUTQM (QueueManagerName|' ')
This parameter allows you to name the queue manager that owns the DLQ
named on the INPUTQ keyword.
If you do not specify a queue manager, or you specify INPUTQM(' ') in the
rules table, the system uses the default queue manager for the installation.
RETRYINT (Interval|60)
This parameter is the interval, in seconds, at which the DLQ handler should
attempt to reprocess messages on the DLQ that could not be processed at the
first attempt, and for which repeated attempts have been requested. By default,
the retry interval is 60 seconds.
WAIT (YES|NO|nnn)
This parameter indicates whether the DLQ handler should wait for further
messages to arrive on the DLQ when it detects that there are no further
messages that it can process.
YES Causes the DLQ handler to wait indefinitely.
NO Causes the DLQ handler to terminate when it detects that the DLQ is
either empty or contains no messages that it can process.
nnn This parameter causes the DLQ handler to wait for nnn seconds for
new work to arrive before terminating, after it detects that the queue is
either empty or contains no messages that it can process.
You can supply the name of the DLQ as an input parameter of the STRMQMDLQ
command, as an alternative to including control data in the rules table. If any
value is specified both in the rules table and on input to the STRMQMDLQ
command, the value specified on the STRMQMDLQ command takes precedence.
Note: If a control-data entry is included in the rules table, it must be the first entry
in the table.
Figure 5. An example rule from a DLQ handler rules table. This rule instructs the DLQ
handler to make 3 attempts to deliver to its destination queue any persistent message that
was put on the DLQ because MQPUT and MQPUT1 were inhibited.
This section describes the keywords that you can include in a rule. Please note the
following:
v The default value for a keyword, if any, is underlined. For most keywords, the
default value is * (asterisk), which matches any value.
v The vertical line (|) separates alternatives. You can specify only one of these.
v All keywords except ACTION are optional.
You can use symbolic names. For example, you can use the symbolic name
MQFB_COA to identify those messages on the DLQ that require confirmation
of their arrival on their destination queues.
FORMAT (Format|*)
This parameter is the name that the sender of the message uses to describe the
format of the message data.
MSGTYPE (MsgType|*)
This parameter is the message type of the message on the DLQ.
You can use symbolic names. For example, you can use the symbolic name
MQMT_REQUEST to identify those messages on the DLQ that require replies.
PERSIST (Persistence|*)
This parameter is the persistence value of the message. (The persistence of a
message determines whether it survives restarts of the queue manager.)
You can use symbolic names. For example, you can use the symbolic name
MQPER_PERSISTENT to identify those messages on the DLQ that are
persistent.
REASON (ReasonCode|*)
This parameter is the reason code that describes why the message was put to
the DLQ.
You can use symbolic names. For example, you can use the symbolic name
MQRC_Q_FULL to identify those messages placed on the DLQ because their
destination queues were full.
REPLYQ (QueueName|*)
This parameter is the reply-to queue name specified in the message descriptor,
MQMD, of the message on the DLQ.
REPLYQM (QueueManagerName|*)
This parameter is the queue manager name, of the reply-to queue, specified in
the REPLYQ keyword.
USERID (UserIdentifier|*)
This parameter is the user ID of the user who originated the message on the
DLQ, as specified in the message descriptor, MQMD.
You must specify the ACTION keyword. The number of attempts made to
implement an action is governed by the RETRY keyword. The RETRYINT
keyword of the control data controls the interval between attempts.
FWDQ (QueueName|&DESTQ|&REPLYQ)
This parameter defines the name of the message queue to which the message
is forwarded when you select the ACTION keyword.
QueueName
This parameter is the name of a message queue. FWDQ(' ') is not
valid.
&DESTQ
Takes the queue name from the DestQName field in the MQDLH
structure.
&REPLYQ
Takes the name from the ReplyToQ field in the message descriptor,
MQMD.
You can specify REPLYQ (?*) in the message pattern to avoid error
messages, when a rule specifying FWDQ (&REPLYQ), matches a
message with a blank ReplyToQ field.
FWDQM (QueueManagerName|&DESTQM|&REPLYQM|' ')
Identifies the queue manager of the queue to which a message is forwarded.
QueueManagerName
This parameter defines the queue manager name, for the queue, to
which the message is forwarded when you select the ACTION (FWD)
keyword.
&DESTQM
Takes the queue manager name from the DestQMgrName field in the
MQDLH structure.
&REPLYQM
Takes the name from the ReplyToQMgr field in the message descriptor,
MQMD.
' ' FWDQM(' '), which is the default value, identifies the local queue
manager.
HEADER (YES|NO)
Specifies whether the MQDLH should remain on a message for which
ACTION (FWD) is requested. By default, the MQDLH remains on the message.
The HEADER keyword is not valid for actions other than FWD.
PUTAUT (DEF|CTX)
Defines the authority with which messages should be put by the DLQ handler:
DEF Puts messages with the authority of the DLQ handler itself.
CTX Causes the messages to be put with the authority of the user ID in the
Note: The count of attempts made by the DLQ handler to implement any
particular rule is specific to the current instance of the DLQ handler; the
count does not persist across restarts. If you restart the DLQ handler, the
count of attempts made to apply a rule is reset to zero.
results in ’ABCD’.
APPLNAME(’ABC-
D’)
This process is repeated for subsequent matching rules until an action is successful.
When each matching rule has been attempted the number of times specified on its
RETRY keyword, and all attempts have failed, ACTION (IGNORE) is assumed.
ACTION (IGNORE) is also assumed if no matching rule is found.
Notes:
1. Matching rule patterns are sought only for messages on the DLQ that begin
with an MQDLH. Messages that do not begin with an MQDLH are reported
periodically as being in error, and remain on the DLQ indefinitely.
2. All pattern keywords can default, so that a rule may consist of an action only.
Note, however, that action-only rules are applied to all messages on the queue
that have MQDLHs and that have not already been processed in accordance
with other rules in the table.
3. The rules table is validated when the DLQ handler starts, and errors flagged at
that time. (Error messages issued by the DLQ handler are described in the
MQSeries Messages book.) You can make changes to the rules table at any time,
but those changes do not come into effect until the DLQ handler is restarted.
4. The DLQ handler does not alter the content of messages, of the MQDLH, or of
the message descriptor. The DLQ handler always puts messages to other
queues with the message option MQPMO_PASS_ALL_CONTEXT.
5. Consecutive syntax errors in the rules table may not be recognized because the
validation of the rules table is designed to eliminate the generation of repetitive
errors.
6. The DLQ handler opens the DLQ with the MQOO_INPUT_AS_Q_DEF option.
7. Multiple instances of the DLQ handler could run concurrently against the same
queue, using the same rules table. However, it is more usual for there to be a
one-to-one relationship between a DLQ and a DLQ handler.
You can take specific measures to enable the DLQ handler to empty the DLQ. For
example, try not to use ACTION (IGNORE), which simply leaves messages on the
DLQ. (Remember that ACTION (IGNORE) is assumed for messages that are not
explicitly addressed by other rules in the table.) Instead, for those messages that
you would otherwise ignore, use an action that moves the messages to another
queue. For example:
Similarly, the final rule in the table should be a catchall to process messages that
have not been addressed by earlier rules in the table. For example, the final rule in
the table could be something like this:
This causes messages that fall through to the final rule in the table to be forwarded
to the queue REALLY.DEAD.QUEUE, where they can be processed manually. If you do
not have such a rule, messages are likely to remain on the DLQ indefinitely.
* Rules
* -----
* We include rules with ACTION (RETRY) first to try to
* deliver the message to the intended destination.
MSGTYPE(MQMT_REQUEST) REPLYQM(AAAA.*) +
ACTION(FWD) FWDQ(DEADQ) FWDQM(&REPLYQM)
DESTQM(bbbb.1) +
action(fwd) fwdq(&DESTQ) fwdqm(bbbb.2) header(no)
REPLYQM(CCCC.*) +
ACTION(FWD) FWDQ(ALARM) FWDQM(CCCC.SYSTEM)
PERSIST(MQPER_NOT_PERSISTENT) ACTION(DISCARD)
REPLYQM(’?*’) +
ACTION(FWD) FWDQ(DEADQ.MANUAL.INTERVENTION) FWDQM(&REPLYQM)
ACTION(FWD) FWDQ(DEADQ.MANUAL.INTERVENTION)
With the exception of channel events, all instrumentation events must be enabled
before they can be generated.
Q ueue M anager
Event message
2. Event m essage
put on event queue
Event queue
Figure 6. Understanding instrumentation events. When a queue manager detects that the
conditions for an event have been met, it puts an event message on the appropriate event
queue.
The event message contains information about the conditions giving rise to the event. An
application can retrieve the event message from the event queue for analysis.
MQSeries for
MQSeries UNIX MQSeries
for MVS/ESA OPERATING SYSTEMS for OS/2
Event
messages
Event monitoring
from a single node
Types of event
MQSeries events are categorized as follows:
Queue manager events
These events are related to the definitions of resources within queue
managers. For example, if an application attempts to update a resource but
the associated user ID is not authorized to perform that operation, a queue
manager event is generated.
Performance events
These events are notifications that a threshold condition has been reached
by a resource. For example, a queue depth limit has been reached or,
following an MQGET request, a queue has not been serviced within a
predefined period of time.
Channel events
These events are reported by channels as a result of conditions detected
during their operation. For example, a channel event is generated when a
channel instance is stopped.
Trigger events
Each category of event has its own event queue. All events in that category result
in an event message being put onto the same queue.
You can define event queues as either local or remote queues. If you define all
your event queues as remote queues on the same queue manager, you can
centralize your monitoring activities.
Event messages
Event messages contain information relating to the origin of an event, including
the type of event, the name of the application that caused the event and, for
performance events, a short statistics summary for the queue.
The format of event messages is similar to that of PCF response messages. The
message data can be retrieved from them by user-written administration programs
using the data structures described in the MQSeries Programmable System
Management book.
To understand the backup and recovery strategy, you should first understand how
MQSeries for AS/400 organizes its data in the OS/400 file system and the
integrated file system (IFS)
MQSeries for AS/400 holds its data in an individual library for each queue
manager, and in stream files in the IFS file system.
The queue manager specific libraries contain journals, journal receivers, and objects
required to control the work management of the queue manager. The IFS
directories and files contain MQSeries configuration files, the descriptions of
MQSeries objects and the data they contain.
QMGRLIB takes the name QM followed by the name of the queue manager in a
unique form. For example, a queue manager named TEST has a journal receiver
library named QMTEST.
These journals have associated journal receivers that contain the information being
journaled. These receivers are objects to which information can only be appended
and will fill up eventually.
They also use up valuable disk space with out-of-date information. However, you
can place the information in permanent storage, to minimize this problem. One
journal receiver is attached to the journal at any particular time. If the journal
receiver reaches its predetermined threshold size, it will be detached and replaced
by a new journal receiver.
The journal receivers associated with the local MQSeries for AS/400 journal exist
in each queue manager library, and adopt a naming convention as follows:
AMQArnnnnn
where
The sequence of the journals is based on date. However, the naming of the next
journal is based on the following rules:
1. AMQArnnnnn goes to AMQAr(nnnnn+1), and nnnnn wraps when it reaches
99999. For example, AMQA000000 goes to AMQA000001, and AMQA999999
goes to AMQA000000.
2. If a journal with a name generated by rule 1 already exists, the message
CPI7OE3 is sent to the QSYSOPR message queue and automatic receiver
switching stops.
The currently attached receiver continues to be used until you investigate the
problem and manually attach a new receiver.
3. If no new name is available in the sequence (that is, all possible journal names
are on the system) you will need to do both the following:
a. Delete journals no longer needed (see “Journal management” on page 78).
b. Record the journal changes into the latest journal receiver using
(RCDMQMIMG) and then repeat the previous step. This will allow the old
journal receiver names to be reused.
The journal receiver’s threshold value is 65,536 KB. This is set when the queue
manager is created and is determined by the MaxReceiverSize value defined in
the LogDefaults stanza of the mqs.ini file. See “Chapter 10. Configuring MQSeries”
on page 101 for further details on configuring the system.
If you need to change the size of journal receivers after the queue manager has
been created, you must create a new journal receiver and set its owner to QMQM
using the following commands:
CRTJRNRCV JRNRCV(QMGRLIB/AMQAnnnnnn) THRESHOLD(xxxxxx) +
TEXT('MQM LOCAL JOURNAL RECEIVER')
CHGOBJOWN OBJ(QMGRLIB/AMQAnnnnnn) OBJTYPE(*JRNRCV) NEWOWN(QMQM)
where
QmgrLib Is the name of your queue manager library
nnnnnnn Is the next journal receiver in the naming sequence described
xxxxxx Is the new receiver threshold (in KB)
The new receiver must now be attached to the AMQAJRN journal with the
command:
CHGJRN JRN(QMGRLIB/AMQAJRN) JRNRCV(QMGRLIB/AMQAnnnnnn)
See “Journal management” on page 78 for details on how to manage these journal
receivers.
The journal receivers can therefore become more up-to-date than the queue files.
To ensure that restart processing begins from a consistent point, MQSeries uses
checkpoints.
A checkpoint is a point in time when the record described in the journal is the
same as the record in the queue. The checkpoint itself consists of the series of
journal records needed to restart the queue manager. For example, the state of all
transactions (that is, units of work) active at the time of the checkpoint.
Checkpoints are generated automatically by MQSeries. They are taken when the
queue manager starts and shuts down, when logging space is running low, and
after every 1000 operations logged.
When MQSeries is restarted, it locates the latest checkpoint record in the log. This
information is held in the checkpoint file that is updated at the end of every
checkpoint. The checkpoint record represents the most recent point of consistency
between the log and the data. The data from this checkpoint is used to rebuild the
queues as they existed at the checkpoint time. When the queues are recreated, the
log is then played forward to bring the queues back to the state they were in
before system failure or close down.
To understand how MQSeries for AS/400 uses the journal, consider the case of a
local queue called TESTQ in the queue manager TESTQM. This is represented by the
IFS file:
/QIBM/UserData/mqm/qmgrs/TESTQM/queues
If a specified message is put on this queue, and then retrieved from the queue, the
actions that take place are shown in Figure 8.
Journal entries
A B C D E Time
The five points, “A” through “E”, shown in the diagram represent points in time
that define the following states:
The key to the recovery capabilities of MQSeries for AS/400 is that the user can
save the IFS file representation of TESTQ as at time A, and subsequently recover
the IFS file representation of TESTQ as at time E, simply by restoring the saved
object and replaying the entries in the journal from time A onwards.
For more information on how the system manages receivers, see the AS/400 Backup
and Recovery book.
Media images
For an MQSeries for AS/400 object of long duration, this can represent a large
number of journal entries, going back to the point at which it was created. To
avoid this overhead, MQSeries for AS/400 has the concept of a media image of an
object.
This media image is a complete copy of the MQSeries for AS/400 object recorded
in the journal. If an image of an object is taken, the object can be rebuilt by
replaying journal entries from this image onwards. The entry in the journal that
represents the replay point for each MQSeries for AS/400 object is referred to as its
media recovery entry.
Images of the three important MQM objects, that is, the *CTLG object, the *ADM
object, and the *MQM object, are regularly taken because these objects are required
for MQSeries for AS/400 to run at all.
Images of other objects are taken when convenient, particularly when the
MQSeries for AS/400 queue manager is ended. MQSeries for AS/400 keeps track
of the:
v Media recovery entry for each MQM object
v Oldest entry from within this set
Rather than allow the date of the oldest media recovery entry to continue for an
unnecessarily long period, you should use the MQSeries for AS/400 command
RCDMQMIMG This command enables you to take an image of selected objects
manually.
You must recover other objects manually, using the MQSeries for AS/400
command RCRMQMOBJ.
This command replays the entries in the journal to recreate the MQSeries object.
Should an MQSeries object become damaged, the only valid actions that may be
performed are to delete it or to re-create it by this method. Note, however, that
nonpersistent messages cannot be recovered in this fashion.
Note: The authorities of the recreated object are not reapplied by this method. The
appropriate authorities must be manually set after the object has been
recreated. When an object is recreated, message AMQ7461 is sent to the system
operator as a reminder to recreate the object authorities.
Note: You may have some difficulty in understanding the names that
appear in the directory. This is because the names are
transformed to ensure that they are compatible with the platform
on which you are using MQSeries. For more information about
where QMGRLIB is the library associated with the queue manager that you
are backing up.
A simple backup strategy is to perform a full backup of the MQSeries for AS/400
libraries every week, and perform a daily journal backup. This, of course, depends
on how you have set up your backup strategy for your enterprise.
Journal management
As part of your backup strategy, you should take care of your journal receivers. It
is useful to remove journal receivers from the MQSeries for AS/400 libraries, in
order to:
1. Release space – applies to all journal receivers
2. Improve the performance when starting (STRMQM)
3. Improve the performance of recreating objects (RCRMQMOBJ) –
Journal receivers can be removed from the queue manager library after they have
been detached from the journals and saved, provided that they are available for
restoration if needed for a recovery operation.
It is important to know how far back in the journals MQSeries for AS/400 is likely
to need to go, in order to determine when a journal receiver that has been backed
up may be removed from the queue manager library, and when the backup itself
may be discarded.
To help determine this time, MQSeries for AS/400 issues two messages to the
queue manager message queue (QMQMMSG in the queue manager library)
whenever it starts up, and whenever it changes a local journal receiver. These
messages are:
AMQ7460
Startup recovery point. This message defines the date and time of the
startup entry from which MQSeries for AS/400 replays the journal in the
event of a startup recovery pass. If the journal receiver that contains this
record is available in the MQSeries for AS/400 libraries, this message also
contains the name of the journal receiver containing the record.
AMQ7462
Oldest media recovery entry. This message defines the date and time of the
oldest entry that may be used for recreating an object from its media
image.
The journal receiver identified is the oldest one required. Any other
MQSeries journal receivers with older creation dates are no longer needed.
If only stars are displayed, you need to restore backups from the date
indicated to determine which is the oldest journal receiver.
MQSeries for AS/400 does not refer to the journal receivers unless it is performing
a recovery pass either for startup, or for recreating an object. If it finds that a
journal it requires is not present, it issues message AMQ7432 to the queue manager
message queue (QMQMMSG) reporting the time and date of the journal entry it
requires to complete the recovery pass.
If this happens, all journal receivers that were detached after this date should be
restored from the backup, in order to allow the recovery pass to succeed.
The journal receiver that contains the startup entry, and any subsequent journal
receivers should be kept available in the queue manager library.
The journal receiver containing the oldest Media Recovery Entry, and any
subsequent journal receivers, should be available at all times, and either present in
the queue manager library or backed-up.
If a journal receiver was partially saved in one journal backup, and fully saved
in a subsequent backup, the fully saved one only should be restored. You are
recommended to restore journals individually, in chronological order.
4. Perform a RST operation, to restore the MQSeries IFS directories to the IFS file
system, using the following command:
RST DEV(...) OBJ(('/QIBM/UserData/mqm/qmgrs/testqm')) ...
5. Start the message queue manager. This will replay all journal records written
since the full backup and restores all the MQSeries for AS/400 objects to the
consistent state at the time of the journal backup.
This is a simple task, and requires the journal receivers to be restored using the
standard AS/400 RSTOBJ command:
RSTOBJ OBJ(QMQMDATA/AMQA000005) OBJTYPE(*JRNRCV) .........
For instance, consider the problem with saved journal AMQAJRN and the
following journal receivers:
AMQA000000
AMQA100000
AMQA200000
AMQA300000
AMQA400000
AMQA500000
AMQA600000
AMQA700000
AMQA800000
AMQA900000
Performance considerations
If you are using a large number of persistent messages or large messages in your
applications, there is an associated overhead due to the journaling of these
messages.
This increases your system disk input/output. If this disk input/output becomes
excessive, performance will suffer.
Ensure that you have sufficient disk activation to cope with this possibility, or
consider a separate ASP in which to hold your queue manager journal receivers.
For more information, see the OS/400 V4R4M0 Backup and Recovery manual.
You should not confuse problem determination with problem solving; however, the
process of problem determination often enables you to solve a problem. For
example, if you find that the cause of the problem is an error in an application
program, you can solve the problem by correcting the error.
However, you may not always be able to solve a problem after determining its
cause. For example:
v A performance problem may be caused by a limitation of your hardware.
v You may find that the cause of the problem is in the MQSeries for AS/400 code.
If this happens, you need to contact your IBM support center for a solution.
This chapter is divided into the following sections:
v “Preliminary checks”
v “Problem characteristics” on page 85
v “Determining problems with MQSeries applications” on page 88
v “Obtaining diagnostic information” on page 91
v “Error logs” on page 94
v “Dead-letter queues” on page 96
v “First-failure support technology (FFST)” on page 97
v “Performance considerations” on page 98
Preliminary checks
Before you start problem determination in detail, it is worth considering the facts
to see if there is an obvious cause of the problem, or an area likely, in which to
start your investigation. This approach to debugging can often save a lot of work
by highlighting a simple error, or by narrowing down the range of possibilities.
The sections that follow raise some fundamental questions that you will need to
consider.
As you go through the questions, make a note of anything that might be relevant
to the problem. Even if your observations do not suggest a cause immediately, they
could be useful later if you have to carry out a systematic problem determination
exercise.
Problem characteristics
Perhaps the preliminary checks have enabled you to find the cause of the problem.
If so, you should now be able to resolve it, possibly with the help of other books in
the MQSeries library, and in the libraries of other licensed programs.
If you have not yet found the cause, you must start to look at the problem in
greater detail. The following questions should be used as pointers to the problem.
Answering the appropriate question, or questions, should lead you to the cause of
the problem.
Queue managers and their associated object names are case sensitive. By default,
the AS/400 uses uppercase characters, unless you surround the name in quotes.
Does the problem affect all users of the MQSeries for AS/400
application?
If the problem only affects some users, look for differences in how the users
configure their systems and queue manager settings.
Check the library lists and user profiles. Can the problem be circumvented by
having *ALLOBJ authority?
Try stopping the command server and then restarting it, responding to any error
messages that are produced.
If the system still does not respond, the problem could be with either a queue
manager or the whole of the MQSeries system. First try stopping individual queue
managers to try and isolate a failing queue manager. If this does not reveal the
problem, try stopping and restarting MQSeries, responding to any messages that
are produced in the error log.
If the problem still occurs after restart, contact your IBM Support Center for help.
If you have still not identified the cause of the problem, see “Determining
problems with MQSeries applications”.
If you are unable to solve the problem, contact your IBM support center for help.
If you are unable to find anything wrong with the queue, and the queue manager
itself is running, make the following checks on the process that you expected to
put the message on to the queue:
v Did the application get started?
If it should have been triggered, check that the correct trigger options were
specified.
v Is a trigger monitor running?
v Was the trigger process defined correctly?
v Did it complete correctly?
Look for evidence of an abnormal end in the job log.
If multiple transactions are serving the queue, they might occasionally conflict with
one another. For example, one transaction might issue an MQGET call with a
buffer length of zero to find out the length of the message, and then issue a
specific MQGET call specifying the MsgId of that message. However, in the
meantime, another transaction might have issued a successful MQGET call for that
message, so the first application receives a completion code of
MQRC_NO_MSG_AVAILABLE. Applications that are expected to run in a
multi-server environment must be designed to cope with this situation.
Consider that the message could have been received, but that your application
failed to process it in some way. For example, did an error in the expected format
of the message cause your program to reject it? If this is the case, refer to
“Messages contain unexpected or corrupted information”.
If these checks do not enable you to solve the problem, you should check your
application logic, both for the program sending the message, and for the program
receiving it.
You should also consider to what destination you want your trace information
sent.
Notes:
1. To run the MQSeries for AS/400 trace commands, you must have the
appropriate authority.
2. Trace data is only written when trace is ended, with option *OFF
Unless you delete it, the trace data remains until the storage monitor is ended, at
which point the trace files are written out to the QMQM spool.
Trace usage
A trace can be obtained using TRCMQM *ON, doing some MQ work, and
TRCMQM *OFF at the end of the MQ work being traced.
Batch jobs inherit the trace attributes of the calling program. Setting trace before
you issue the command that starts a batch job, has the advantage that the batch job
will be traced from its start.
Selective trace
By default, TRCMQM traces all MQSeries product components saving the
maximum amount of trace data and using the *WRAP option in cases where the
trace file becomes full.
You can reduce the amount of trace data being saved, thereby improving run-time
performance, using the command TRCMQM *ON with F4=prompt to customize the
TRCTYPE parameter.
where:
Error logs
MQSeries uses a number of error logs to capture messages concerning the
operation of MQSeries itself, any queue managers that you start, and error data
coming from the channels that are in use.
The location of the error logs depends on whether the queue manager name is
known.
In the IFS:
v If the queue manager name is known and the queue manager is available, error
logs are located in:
/QIBM/UserData/mqm/qmname/errors
v If the queue manager is not available, error logs are located in:
/QIBM/UserData/mqm/@SYSTEM/errors
You can use the system utility EDTF to browse the errors directories and files. For
example:
EDTF '/QIBM/UsedData/mqm/errors'
Log files
At installation time an @SYSTEM errors subdirectory is created in the IFS. The
errors subdirectory can contain up to three error log files named:
v AMQERR01.LOG
v AMQERR02.LOG
v AMQERR03.LOG
After you have created a queue manager, three error log files are created when
they are needed by the queue manager. These files have the same names as the
@SYSTEM ones, that is AMQERR01, AMQERR02, and AMQERR03, and each has a
capacity of 256 KB. The files are placed in the errors subdirectory of each queue
manager that you create, that is /QIBM/UserData/mqm/qmname/errors.
The latest error messages are thus always placed in AMQERR01, the other files
being used to maintain a history of error messages.
All messages relating to channels are also placed in the appropriate queue
manager’s errors files unless the name of their queue manager is unknown or the
To examine the contents of any error log file, use your usual system editor,EDTF,
to view the stream files in the IFS.
Early errors
There are a number of special cases where the above error logs have not yet been
established and an error occurs. MQSeries attempts to record any such errors in an
error log. The location of the log depends on how much of a queue manager has
been established.
If, due to a corrupt configuration file for example, no location information can be
determined, errors are logged to an errors directory that is created at installation
time.
If the MQSeries configuration file is readable, and the DefaultPrefix attribute of the
AllQueueManagers stanza is readable, errors are logged in the errors subdirectory
of the directory identified by the DefaultPrefix attribute.
Operator messages
Operator messages identify normal errors, typically caused directly by users doing
things like using parameters that are not valid on a command. Operator messages
are national language enabled, with message catalogs installed in standard
locations.
These messages are written to the joblog, if any. In addition, some operator
messages are written to the AMQERR01.LOG file in the queue manager directory,
and others to the @SYSTEM directory copy of the error log.
Dead-letter queues
Messages that cannot be delivered for some reason are placed on the dead-letter
queue. You can check whether the queue contains any messages by issuing an
DSPMQMQ command. If the queue contains messages, you can use the
WRKMQMMSG command to display a list of messages on a queue. Option 5
displays the details of the messages and option 8 displays the message data.
You must decide how to dispose of any messages found on the dead-letter queue,
depending on the reasons for the messages being put on the queue.
Problems may occur if you do not associate a dead-letter queue with each queue
manager. For more information about dead-letter queues, see “Chapter 6. The
MQSeries dead-letter queue handler” on page 57.
The Function Stack and Trace History are used by IBM to assist in problem
determination. In most cases there is little that the system administrator can do
when an FFST report is generated, apart from raising problems through the IBM
Support Centers.
Performance considerations
This section discusses:
v General design considerations - see “Application design considerations”
v Specific performance problems - see “Specific performance problems” on
page 100
If your application cannot use messages of a fixed length, another solution to this
problem is to use the MQINQ call to find the maximum size of messages that the
queue can accept, then use this value in your MQGET call. The maximum size of
messages for a queue is stored in the MaxMsgLen attribute of the queue. This
method could use large amounts of storage, however, because the value of this
queue attribute could be as high as 2 GB, the maximum allowed by MQSeries for
AS/400.
Frequency of syncpoints
Programs that issue numerous MQPUT calls within syncpoint, without committing
them, can cause performance problems. Affected queues can fill up with messages
that are currently unusable, while other tasks might be waiting to get these
messages. This has implications in terms of storage, and in terms of threads tied
up with tasks that are attempting to get messages.
If some applications are troublesome, it could be due to their design using too
many threads. Consider whether the application takes into account this possibility
and that it takes actions either to stop or to report this type of occurrence.
The maximum number of threads that AS/400 allows is 4095. However, the default
is 64. MQSeries makes available up to 63 threads to its processes.
Storage problems
If you receive the system message CPF0907. Serious storage condition may exist
it is possible that you are filling up the space associated with the MQSeries for
AS/400 queue managers.
If you find that performance degradation is not dependent on system loading, but
happens sometimes when the system is lightly loaded, then a poorly designed
application program is probably to blame. This could manifest itself as a problem
that only occurs when certain queues are accessed.
The following symptoms might indicate that MQSeries for AS/400 is running
slowly:
v If your system is slow to respond to MQSeries for AS/400 commands.
v If repeated displays of the queue depth indicate that the queue is being
processed slowly for an application with which you would expect a large
amount of queue activity.
v Is MQ Trace being run?
This chapter:
v Describes the AS/400 methods for reconfiguring MQSeries in MQSeries
configuration files.
v Describes the attributes you can use to modify MQSeries configuration
information in “Attributes for changing MQSeries configuration information” on
page 103.
v Describes the attributes you can use to modify queue manager configuration
information in “Changing queue manager configuration information” on page
106.
v Provides examples of mqs.ini and qm.ini files for MQSeries for AS/400 in
“Example mqs.ini and qm.ini files” on page 109.
Note that .ini files are stream files resident in the IFS.
Any changes you make to a configuration file will not take effect until the next
time the queue manager is started.
If you set an incorrect value on a configuration file attribute, the value is ignored
and an operator message is issued to indicate the problem. (The effect is the same
as missing out the attribute entirely.)
Note: In the descriptions of the stanzas, the value underlined is the default value
and the “|” symbol means “or”.
If you change the default prefix for the queue manager, you must replicate the
directory structure that was created at installation time.
In particular, the qmgrs structure must be created. You must stop MQSeries
before changing the default prefix, and restart MQSeries only after the
structures have been moved to the new location and the default prefix has
been changed.
As an alternative to changing the default prefix, you can use the environment
variable MQSPREFIX to override the DefaultPrefix for the crtmqm command.
ConvEBCDICNewline=NL_TO_LF|TABLE|ISO
EBCDIC code pages contain a new line (NL) character that is not supported by
ASCII code pages; although some ISO variants of ASCII do contain an
equivalent.
Note that the effect of this type of conversion may vary from platform to
platform and from language to language; while on the same platform, the
behavior may vary if you use different CCSIDs.
ISO
Specify ISO if you want:
v ISO CCSIDs to be converted using the TABLE method
v All other CCSIDs to be converted using the NL_TO_CF method.
If a problem arises with the user-written CLWL exit when running in SAFE
mode, the following happens:
v The CLWL server process (amqzlwa0) fails.
v The queue manager restarts the CLWL server process.
v The error is reported to you in the error log. If an MQI call is in
progress, you receive notification in the form of a bad return code.
If a problem arises when the CLWL exit is running in FAST mode, the
queue manager will fail and you run the risk of the integrity of the queue
manager being compromised.
See “Understanding MQSeries queue manager library names” on page 111 for more
information about name transformation.
Name=queue_manager_name
This attribute specifies the name of the queue manager.
Prefix=prefix
This attribute specifies where the queue manager files are stored. By default,
this is the same as the value specified on the DefaultPrefix attribute of the
AllQueueManager stanza in the mqs.ini file.
Directory=name
This attribute specifies the name of the subdirectory under the <prefix>\QMGRS
directory where the queue manager files are stored. This name is based on the
queue manager name but can be transformed if there is a duplicate name, or if
the queue manager name is not a valid file name.
Library=name
This attribute specifies the name of the library where OS/400 objects that apply
Only change attributes of this stanza if this particular queue manager needs to be
configured differently from your other ones.
The values specified on the attributes in the qm.ini file are read when the queue
manager is started. The file is created when the queue manager is created.
LogPath=library_name
The name of the library used to store journals and journal receivers for this
queue manager.
LogReceiverSize
Journal receiver size.
If you specify the AdoptNewMCA attribute for a given channel type but the new
channel fails to start because the channel is already running:
1. The new channel tries to stop the previous one by politely inviting it to
end.
2. If the previous channel server does not respond to this invitation by the
time the AdoptNewMCATimeout wait interval expires, the process (or the
thread) for the previous channel server is killed.
3. If the previous channel server has not ended after step 2, and after the
AdoptNewMCATimeout wait interval expires for a second time, MQSeries
ends the channel with a “CHANNEL IN USE” error.
You specify one or more values, separated by commas or blanks, from the
following list:
NO The AdoptNewMCA feature is not required. This is the default.
SVR Adopt server channels.
SNDR Adopt sender channels.
RCVR Adopt receiver channels.
CLUSRCVR
Adopt cluster receiver channels.
ALL Adopt all channel types, except for FASTPATH channels.
FASTPATH
Adopt the channel if it is a FASTPATH channel. This happens only if
the appropriate channel type is also specified, for example,
AdoptNewMCA=RCVR,SVR,FASTPATH.
Note
The AdoptNewMCA attribute may behave in an unpredictable
fashion with FASTPATH channels because of the internal design
of the queue manager. Therefore exercise great caution when
enabling the AdoptNewMCA attribute for FASTPATH channels.
AdoptNewMCATimeout=60|1—3600
This attribute specifies the amount of time, in seconds, that the new process
should wait for the old process to end. Specify a value, in seconds, in the
range 1—3600. The default value is 60.
AdoptNewMCACheck=QM|ADDRESS|NAME|ALL
The AdoptNewMCACheck attribute allows you to specify the type checking
required when enabling the AdoptNewMCA attribute. It is important for you to
perform all three of the following checks, if possible, to protect your channels
from being, inadvertently or maliciously, shut down. At the very least check
that the channel names match.
If the backlog reaches the value of 255, the TCP/IP connection is rejected
and the channel will not be able to start.
For MCA channels, this results in the channel going into a RETRY state
and retrying the connection at a later time.
#***********************************************************************#
#* Module Name: mqs.ini *#
#* Type : MQSeries Configuration File *#
#* Function : Define MQSeries resources for the node *#
#* *#
#***********************************************************************#
#* Notes : *#
#* 1) This is an example MQSeries configuration file *#
#* *#
#***********************************************************************#
AllQueueManagers:
#***********************************************************************#
#* The path to the qmgrs directory, below which queue manager data *#
#* is stored *#
#***********************************************************************#
DefaultPrefix=/QIBM/UserData/mqm
QueueManager:
Name=saturn.queue.manager
Prefix=/QIBM/UserData/mqm
Library=QMSATURN.Q
Directory=saturn!queue!manager
QueueManager:
Name=pluto.queue.manager
Prefix=/QIBM/UserData/mqm
Library=QMPLUTO.QU
Directory=pluto!queue!manager
DefaultQueueManager:
Name=saturn.queue.manager
CHANNELS:
MaxChannels = 20 ; Maximum number of Channels allowed.
; Default is 100.
MaxActiveChannels = 10 ; Maximum number of Channels allowed to be
; active at any time. The default is the
; value of MaxChannels.
Notes:
1. MQSeries on the node is using the default locations for queue managers and
the journals.
2. The queue manager saturn.queue.manager is the default queue manager for the
node. The directory for files associated with this queue manager has been
automatically transformed into a valid file name for the file system.
3. Because the MQSeries configuration file is used to locate the data associated
with queue managers, a nonexistent or incorrect configuration file can cause
some or all MQSeries commands to fail. Also, applications cannot connect to a
queue manager that is not defined in the MQSeries configuration file.
The characters that can be used for all MQSeries names are:
v Uppercase A–Z
v Numerics 0–9
v Period (.)
v Underscore (_)
v Lowercase a–z (see note 1)
v Forward slash (/) (see note 1)
v Percent sign (%) (see note 1)
Notes:
1. Lowercase a–z, forward slash, and percent are special characters. If you use any
of these characters in a name, the name must be enclosed in quotation marks.
(Lowercase a–z characters are changed to uppercase if the name is not enclosed
in quotation marks.)
You cannot use lowercase characters on systems using EBCDIC Katakana.
2. Leading or embedded blanks are not allowed.
The queue manager name must therefore be transformed to give a unique library
name. The rules for governing this transformation are:
1. Add QM to the start of the name
v Truncate the name to 10 characters.
v Convert individual characters so that ‘%’ becomes ‘_”, and ‘/’ becomes ‘#’.
Each MQSeries queue, queue manager, namelist, and process object is represented
by a file. Because object names are not necessarily valid file names, the queue
manager converts the object name into a valid file name where necessary.
In the same way that a library is created for each queue manager, each queue
manager is also represented by a file. There are limitations to the maximum length
a file name can have, and to the characters that can be used in the name. As a
result, the names of IFS files representing objects are automatically transformed to
meet the requirements of the file system.
The rules governing the transformation of a queue manager name, using the
example of a queue manager with the name queue.manager, are as follows:
1. Transform individual characters: .becomes! and / becomes &.
2. If the name is still not valid:
a. Truncate it to eight characters
b. Append a three-character numeric suffix
For example, assuming the default prefix, the queue manager name in MQSeries
for AS/400 becomes /QIBM/UserData/mqm/qmgrs/queue!manager.
The following tables list the system and default objects created by CRTMQM:
v Table 12 lists the system and default queue objects.
v Table 13 lists the system and default channel objects.
v Table 14 lists the system and default process objects.
Table 12. System and default objects - queues
Object name Description
SYSTEM.ADMIN.CHANNEL.EVENT Event queue for channels.
SYSTEM.ADMIN.COMMAND.QUEUE Administration command queue. Used for
remote MQSC commands and PCF
commands.
SYSTEM.ADMIN.PERFM.EVENT Event queue for performance events.
SYSTEM.ADMIN.QMGR.EVENT Event queue for queue manager events.
SYSTEM.CHANNEL.INITQ Channel initiation queue.
SYSTEM.CHANNEL.SYNCQ The queue which holds the
synchronization data for channels.
SYSTEM.CICS.INITIATION.QUEUE Default CICS initiation queue.
SYSTEM.CLUSTER.COMMAND.QUEUE The queue used to carry messages to the
repository queue manager.
SYSTEM.CLUSTER.REPOSITORY.QUEUE The queue used to store all repository
information.
SYSTEM.CLUSTER.TRANSMIT.QUEUE The transmission queue for all messages to
all clusters.
SYSTEM.DEAD.LETTER.QUEUE Dead-letter (undelivered message queue).
SYSTEM.DEFAULT.ALIAS.QUEUE Default alias queue.
SYSTEM.DEFAULT.INITIATION.QUEUE Default initiation queue.
SYSTEM.DEFAULT.LOCAL.QUEUE Default local queue.
SYSTEM.DEFAULT.MODEL.QUEUE Default model queue.
SYSTEM.DEFAULT.REMOTE.QUEUE Default remote queue.
/********************************************************************/
/* EXAMPLES OF DIFFERENT QUEUE TYPES */
/* */
/* Create local, alias and remote queues */
/* */
/* Uses system defaults for most attributes */
/* */
/********************************************************************/
/* Create a local queue */
CRTMQMQ QNAME(’SYSTEM.SAMPLE.LOCAL’) +
QTYPE(*LCL) REPLACE(*YES) +
+
TEXT(’Sample local queue’) /* description */+
SHARE(*YES) /* Shareable */+
DFTMSGPST(*YES) /* Persistent messages OK */
/********************************************************************/
/* SPECIFIC QUEUES AND PROCESS USED BY SAMPLE PROGRAMS */
/* */
/* Create local queues used by sample programs */
/* Create MQI process associated with sample initiation queue */
/* */
/********************************************************************/
/* General reply queue */
CRTMQMQ QNAME(’SYSTEM.SAMPLE.REPLY’) +
QTYPE(*LCL) REPLACE(*YES) +
+
TEXT(’General reply queue’) +
DFTMSGPST(*YES) /* Persistent messages OK */
CRTMQMPRC PRCNAME(’SYSTEM.SAMPLE.SETPROCESS’) +
REPLACE(*YES) +
+
TEXT(’trigger process for AMQSSETA’) +
ENVDATA(’JOBPTY(3)’) /* Submit parameter */ +
/** Select the triggered program here **/ +
APPID(’AMQSSETA’) /* C */ +
/* APPID(’AMQ0SETA’) /* COBOL */ +
/* APPID(’AMQ1SET4’) /* RPG - OPM */ +
/* APPID(’AMQ2SET4’) /* RPG - ILE */
CRTMQMPRC PRCNAME(’SYSTEM.SAMPLE.ECHOPROCESS’) +
REPLACE(*YES) +
+
TEXT(’trigger process for AMQSECHA’) +
ENVDATA(’JOBPTY(3)’) /* Submit parameter */ +
/** Select the triggered program here **/ +
APPID(’AMQSECHA’) /* C */ +
/* APPID(’AMQ0ECHA’) /* COBOL */ +
/* APPID(’AMQ1ECH4’) /* RPG - OPM */ +
/* APPID(’AMQ2ECH4’) /* RPG - ILE */
/********************************************************************/
/* Normal return. */
/********************************************************************/
RETURN
ENDPGM
/********************************************************************/
/* END OF AMQSAMP4 */
/********************************************************************/
IBM may have patents or pending patent applications covering subject matter
described in this information. The furnishing of this information does not give you
any license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
U.S.A.
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, OR FITNESS
FOR A PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore this statement may not apply
to you.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those Web
sites. The materials at those Web sites are not part of the materials for this IBM
product and use of those Web sites is at your own risk.
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:
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Programming License Agreement, or any equivalent agreement
between us.
Trademarks
The following terms are trademarks of the IBM Corporation in the United States,
or other countries, or both:
Java and all Java-based trademarks and logos are trademarks or registered
trademarks of Sun Microsystems, Inc. in the United States and/or other countries.
Microsoft, Windows, Windows NT, and the Windows logo are trademarks of
Microsoft Corporation in the United States and/or other countries.
application log. In Windows NT, a log that records CCF. Channel control function.
significant application events.
CCSID. Coded character set identifier.
application queue. A queue used by an application.
CDF. Channel definition file.
channel definition file (CDF). In MQSeries, a file command processor. The MQSeries component that
containing communication channel definitions that processes commands.
associate transmission queues with communication
links. command server. The MQSeries component that reads
commands from the system-command input queue,
channel event. An event indicating that a channel verifies them, and passes valid commands to the
instance has become available or unavailable. Channel command processor.
events are generated on the queue managers at both
ends of the channel. commit. An operation that applies all the changes
made during the current unit of recovery or unit of
checkpoint. A time when significant information is work. After the operation is complete, a new unit of
written on the log. Contrast with syncpoint. In recovery or unit of work begins. Contrast with backout.
MQSeries on UNIX systems, the point in time when a
data record described in the log is the same as the data completion code. A return code indicating how an
record in the queue. Checkpoints are generated MQI call has ended.
automatically and are used during the system restart
process. configuration file. In MQSeries on UNIX systems,
MQSeries for AS/400, MQSeries for OS/2 Warp, and
CICS transaction. In CICS, a unit of application MQSeries for Windows NT, a file that contains
processing, usually comprising one or more units of configuration information related to, for example, logs,
work. communications, or installable services. Synonymous
with .ini file. See also stanza.
circular logging. In MQSeries on UNIX systems,
MQSeries for OS/2 Warp, and MQSeries for Windows connect. To provide a queue manager connection
NT, the process of keeping all restart data in a ring of handle, which an application uses on subsequent MQI
log files. Logging fills the first file in the ring and then calls. The connection is made either by the MQCONN
moves on to the next, until all the files are full. At this call, or automatically by the MQOPEN call.
point, logging goes back to the first file in the ring and
starts again, if the space has been freed or is no longer connection handle. The identifier or token by which a
needed. Circular logging is used during restart program accesses the queue manager to which it is
recovery, using the log to roll back transactions that connected.
were in progress when the system stopped. Contrast
context. Information about the origin of a message.
with linear logging.
context security. In MQSeries, a method of allowing
client. A run-time component that provides access to
security to be handled such that messages are obliged
queuing services on a server for local user applications.
to carry details of their origins in the message
The queues used by the applications reside on the
descriptor.
server. See also MQSeries client.
control command. In MQSeries on UNIX systems,
client application. An application, running on a
MQSeries for OS/2 Warp, and MQSeries for Windows
workstation and linked to a client, that gives the
NT, a command that can be entered interactively from
application access to queuing services on a server.
the operating system command line. Such a command
client connection channel type. The type of MQI requires only that the MQSeries product be installed; it
channel definition associated with an MQSeries client. does not require a special utility or program to run it.
See also server connection channel type.
controlled shutdown. See quiesced shutdown.
cluster. A network of queue managers that are
logically associated in some way. D
coded character set identifier (CCSID). The name of a data bag. In the MQAI, a bag that allows you to
coded set of characters and their code point handle properties (or parameters) of objects.
assignments.
data conversion interface (DCI). The MQSeries event log. See application log.
interface to which customer- or vendor-written
programs that convert application data between event message. Contains information (such as the
different machine encodings and CCSIDs must category of event, the name of the application that
conform. A part of the MQSeries Framework. caused the event, and queue manager statistics) relating
to the origin of an instrumentation event in a network
datagram. The simplest message that MQSeries of MQSeries systems.
supports. This type of message does not require a reply.
event queue. The queue onto which the queue
DCE. Distributed Computing Environment. manager puts an event message after it detects an
event. Each category of event (queue manager,
DCI. Data conversion interface. performance, or channel event) has its own event
queue.
dead-letter queue (DLQ). A queue to which a queue
manager or application sends messages that it cannot Event Viewer. A tool provided by Windows NT to
deliver to their correct destination. examine and manage log files.
dead-letter queue handler. An MQSeries-supplied
utility that monitors a dead-letter queue (DLQ) and F
processes messages on the queue in accordance with a
user-written rules table. FFST. First Failure Support Technology.
E H
event. See channel event, instrumentation event, handle. See connection handle and object handle.
performance event, and queue manager event.
IP. Internet Protocol. LU 6.2. A type of logical unit (LU) that supports
general communication between programs in a
distributed processing environment.
L
linear logging. In MQSeries on UNIX systems, M
MQSeries for OS/2 Warp, and MQSeries for Windows
NT, the process of keeping restart data in a sequence of MCA. Message channel agent.
files. New files are added to the sequence as necessary.
The space in which the data is written is not reused MCI. Message channel interface.
until the queue manager is restarted. Contrast with
media image. In MQSeries on UNIX systems,
circular logging.
MQSeries for OS/2 Warp, and MQSeries for Windows
message. In message queuing applications, a MQI channel. Connects an MQSeries client to a queue
communication sent between programs. See also manager on a server system, and transfers only MQI
persistent message and nonpersistent message. In system calls and responses in a bidirectional manner. Contrast
programming, information intended for the terminal with message channel.
operator or system administrator.
MQSC. MQSeries commands.
message channel. In distributed message queuing, a
mechanism for moving messages from one queue MQSeries. A family of IBM licensed programs that
manager to another. A message channel comprises two provides message queuing services.
message channel agents (a sender at one end and a
MQSeries Administration Interface (MQAI). A
receiver at the other end) and a communication link.
programming interface to MQSeries.
Contrast with MQI channel.
MQSeries client. Part of an MQSeries product that
message channel agent (MCA). A program that
can be installed on a system without installing the full
transmits prepared messages from a transmission
queue manager. The MQSeries client accepts MQI calls
queue to a communication link, or from a
from applications and communicates with a queue
communication link to a destination queue. See also
manager on a server system.
message queue interface.
MQSeries commands (MQSC). Human readable
message channel interface (MCI). The MQSeries
commands, uniform across all platforms, that are used
interface to which customer- or vendor-written
to manipulate MQSeries objects. Contrast with
programs that transmit messages between an MQSeries
programmable command format (PCF).
queue manager and another messaging system must
conform. A part of the MQSeries Framework.
N
message descriptor. Control information describing
the message format and presentation that is carried as namelist. An MQSeries object that contains a list of
part of an MQSeries message. The format of the names, for example, queue names.
message descriptor is defined by the MQMD structure.
name service. In MQSeries on UNIX systems,
message priority. In MQSeries, an attribute of a MQSeries for OS/2 Warp, and MQSeries for Windows
message that can affect the order in which messages on NT, the facility that determines which queue manager
a queue are retrieved, and whether a trigger event is owns a specified queue.
generated.
name service interface (NSI). The MQSeries interface
message queue. Synonym for queue. to which customer- or vendor-written programs that
resolve queue-name ownership must conform. A part of
message queue interface (MQI). The programming the MQSeries Framework.
interface provided by the MQSeries queue managers.
This programming interface allows application name transformation. In MQSeries on UNIX systems,
programs to access message queuing services. MQSeries for OS/2 Warp, and MQSeries for Windows
NT, an internal process that changes a queue manager
message queuing. A programming technique in which name so that it is unique and valid for the system
each program within an application communicates with being used. Externally, the queue manager name
the other programs by putting messages on queues. remains unchanged.
message sequence numbering. A programming NetBIOS. Network Basic Input/Output System. An
technique in which messages are given unique numbers operating system interface for application programs
during transmission over a communication link. This used on IBM personal computers that are attached to
enables the receiving process to check whether all the IBM Token-Ring Network.
messages are received, to place them in a queue in the
original order, and to discard duplicate messages. New Technology File System (NTFS). A Windows NT
recoverable file system that provides security for files.
messaging. See synchronous messaging and asynchronous
messaging. nonpersistent message. A message that does not
survive a restart of the queue manager. Contrast with
model queue object. A set of queue attributes that act persistent message.
as a template when a program creates a dynamic
queue. NSI. Name service interface.
PCF command. See programmable command format. program temporary fix (PTF). A solution or by-pass of
a problem diagnosed by IBM field engineering as the
pending event. An unscheduled event that occurs as a result of a defect in a current, unaltered release of a
result of a connect request from a CICS adapter. program.
percolation. In error recovery, the passing along a PTF. Program temporary fix.
preestablished path of control from a recovery routine
to a higher-level recovery routine.
Q
performance event. A category of event indicating
that a limit condition has occurred. queue. An MQSeries object. Message queuing
applications can put messages on, and get messages
performance trace. An MQSeries trace option where from, a queue. A queue is owned and maintained by a
the trace data is to be used for performance analysis queue manager. Local queues can contain a list of
and tuning. messages waiting to be processed. Queues of other
types cannot contain messages—they point to other
permanent dynamic queue. A dynamic queue that is
queues, or can be used as models for dynamic queues.
deleted when it is closed only if deletion is explicitly
server connection channel type. The type of MQI system bag. A type of data bag that is created by the
channel definition associated with the server that runs MQAI.
a queue manager. See also client connection channel type.
system.command.input queue. A local queue on
service interval. A time interval, against which the which application programs can put MQSeries
elapsed time between a put or a get and a subsequent commands. The commands are retrieved from the
get is compared by the queue manager in deciding queue by the command server, which validates them
whether the conditions for a service interval event have and passes them to the command processor to be run.
been met. The service interval for a queue is specified
by a queue attribute. system control commands. Commands used to
manipulate platform-specific entities such as buffer
service interval event. An event related to the service pools, storage classes, and page sets.
interval.
Systems Network Architecture (SNA). The
shell. In the AIX and UNIX environments, a software description of the logical structure, formats, protocols,
interface between a user and the operating system of a and operational sequences for transmitting information
computer. Shell programs interpret commands and units through, and controlling the configuration and
communicate them to the operating system. operation of, networks.
Transmission Control Protocol/Internet Protocol user bag. In the MQAI, a type of data bag that is
(TCP/IP). A suite of communication protocols that created by the user.
support peer-to-peer connectivity functions for both
User Datagram Protocol (UDP). Part of the TCP/IP
local and wide area networks.
protocol suite. A packet-level protocol built directly on
transmission program. See message channel agent. the Internet Protocol layer. UDP is a connectionless and
less reliable alternative to TCP. It is used for
transmission queue. A local queue on which prepared application-to-application programs between TCP/IP
messages destined for a remote queue manager are host systems.
temporarily stored.
user identifier service (UIS). In MQSeries for OS/2
trigger event. An event (such as a message arriving Warp, the facility that allows MQI applications to
on a queue) that causes a queue manager to create a associate a user ID, other than the default user ID, with
trigger message on an initiation queue. MQSeries messages.
triggering. In MQSeries, a facility allowing a queue utility. In MQSeries, a supplied set of programs that
manager to start an application automatically when provide the system operator or system administrator
predetermined conditions on a queue are satisfied. with facilities in addition to those provided by the
MQSeries commands. Some utilities invoke more than
trigger message. A message containing information one function.
about the program that a trigger monitor is to start.
Bibliography 135
MQSeries LotusScript Extension, v MQSeries for HP-UX, V5.1
SC34-5404 v MQSeries for OS/2 Warp, V5.1
v MQSeries for Sun Solaris, V5.1
v MQSeries for Windows NT, V5.1
Softcopy books v MQSeries link for R/3 V1.2
Most of the MQSeries books are supplied in both
hardcopy and softcopy formats. PDF versions of all current MQSeries books are
also available from the MQSeries product family
BookManager format Web site at:
http://www.ibm.com/software/ts/mqseries/
The MQSeries library is supplied in IBM
BookManager format on a variety of online
library collection kits, including the Transaction PostScript format
Processing and Data collection kit, SK2T-0730. You The MQSeries library is provided in PostScript
can view the softcopy books in IBM BookManager (.PS) format with many MQSeries Version 2
format using the following IBM licensed products. Books in PostScript format can be
programs: printed on a PostScript printer or viewed with a
BookManager READ/2 suitable viewer.
BookManager READ/6000
BookManager READ/DOS Windows Help format
BookManager READ/MVS
The MQSeries for Windows User’s Guide is
BookManager READ/VM
provided in Windows Help format with MQSeries
BookManager READ for Windows
for Windows Version 2.0 and MQSeries for
Windows Version 2.1.
HTML format
Relevant MQSeries documentation is provided in
HTML format with these MQSeries products:
MQSeries information available
v MQSeries for AIX, V5.1 on the Internet
v MQSeries for AS/400, V5.1
The MQSeries product family Web site is at:
v MQSeries for HP-UX, V5.1
v MQSeries for OS/2 Warp, V5.1 http://www.ibm.com/software/ts/mqseries/
v MQSeries for Sun Solaris, V5.1
v MQSeries for Windows NT, V5.1 (compiled By following links from this Web site you can:
HTML) v Obtain latest information about the MQSeries
v MQSeries link for R/3 V1.2 product family.
The MQSeries books are also available in HTML v Access the MQSeries books in HTML and PDF
format from the MQSeries product family Web formats.
site at: v Download MQSeries SupportPacs.
http://www.ibm.com/software/ts/mqseries/
Related publications
Portable Document Format (PDF) AS/400 CL Reference Common CL Information,
PDF files can be viewed and printed using the SC41-5722
Adobe Acrobat Reader. AS/400 Backup and Recovery, SC41-5304
AS/400 Security - Reference, SC41-5302
If you need to obtain the Adobe Acrobat Reader, AS/400 National Language Support, SC41-5101
or would like up-to-date information about the AS/400 System API Reference, SC41-5801
platforms on which the Acrobat Reader is
supported, visit the Adobe Systems Inc. Web site
at:
http://www.adobe.com/
Index 139
S USERID keyword, rules table
using CL commands 13
60
security
administration authorizations 50
command security requirements 55
considerations 43
context authority 54
V
MQI authorizations 47 variable length, performance
MQSC channel commands 55 considerations 99
MQSeries authorities 44
object authority manager (OAM) 44
remote queues 54
resources protected by the OAM 44
W
security requirements for PCF WAIT keyword, rules table 58
commands 55 Windows Help 136
sensitive operations, OAM 53
work management
sensitive operations, OAM 53
servers 9 objects 38
softcopy books 136 tasks 38
stanzas using 39
AllQueueManagers, mqs.ini 103
Channels, qm.ini 106
DefaultQueueManager, mqs.ini 104
ExitProperties, mqs.ini 104
Log, qm.ini 106
QueueManager, mqs.ini 105
TCP, qm.ini 108
starting a command server 34
stopping a command server 35
storage problems 100
STRMQMDLQ command 57
syncpoint, performance
considerations 99
system default objects 9
system objects 113
T
TCP stanza, qm.ini 108
temporary (dynamic) queues 3
terminology used in this book 123
time-independent applications 1
trace, performance considerations 92
trace data
formatting 93
lifetime of 92
selective 92
usage of 92
transactional support, updating under
syncpoint control 10
transmission queues
cluster transmission queues 7
description of 7
triggering
defining an application queue for
triggering 25
event queues 70
managing objects for triggering 25
message-driven processing 1
trigger events 70
types of event 69
U
user exits
channel exits 10
data conversion exits 10
Feel free to comment on what you regard as specific errors or omissions, and on
the accuracy, organization, subject matter, or completeness of this book.
Please limit your comments to the information in this book and the way in which
the information is presented.
When you send comments to IBM, you grant IBM a nonexclusive right to use or
distribute your comments in any way it believes appropriate, without incurring
any obligation to you.
You can send your comments to IBM in any of the following ways:
v By mail, to this address:
Information Development Department (MP095)
IBM United Kingdom Laboratories
Hursley Park
WINCHESTER,
Hampshire
United Kingdom
v By fax:
– From outside the U.K., after your international access code use
44–1962–870229
– From within the U.K., use 01962–870229
v Electronically, use the appropriate network ID:
– IBM Mail Exchange: GBIBM2Q9 at IBMMAIL
™
– IBMLink : HURSLEY(IDRCF)
– Internet: [email protected]
SC34-5558-00
Spine information:
IBM MQSeries® for AS/400® MQSeries for AS/400, V5.1 System Administration V5.1