To
create a Queue Manager, our userID needs to be part of the mqm group. If we do
not have the appropriate authority, then we need to ask our MQ administrator to
issue this command.
The
command to create a Queue Manager is CRTMQM and there are various
parameters available with this command:
crtmqm [-z] [-q] [-c Text] [-d DefXmitQ] [-h MaxHandles]
[-g ApplicationGroup] [-t
TrigInt]
[-u DeadQ] [-x MaxUMsgs] [-lp
LogPri] [-ls LogSec]
[-lc | -ll] [-lf LogFileSize]
[-ld LogPath] QMgrName
The
only required parameter is the Queue Manager name (QMgrName), which can
be up to 48 characters in length. The optional parameters are:
- -c <text>: Descriptive text (up to 64 characters) for this Queue Manager.
- -d <DefaultTransmissionQueue>: The name of the local Transmission Queue where remote messages are put if a Transmission Queue is not explicitly defned for their destination. There is no default.
- -g <ApplicationGroup>: The name of the group containing members allowed to: run MQI applications, update all IPCC resources, change the contents of some queue manager directories. This option applies only to WebSphere MQ for AIX, Solaris, HP-UX, and Linux. The default value is -g all, which allows unrestricted access. The -g ApplicationGroup value is recorded in the Queue Manager confguration fle, qm.ini. The mqm userID and the user executing the command must belong to the specifed ApplicationGroup.
- -h <MaximumHandleLimit>: (default 256). The maximum number of handles that any one application can have open at the same time. The range is 1 through 999,999,999.
- -lc: Use circular logging. This is the default logging method.
- -ll: Use linear logging.
- -ld <LogPath>: The directory used to hold log fles. On Windows, the default is C:\Program Files\IBM\WebSphere MQ\log (assuming that C is the data drive). On UNIX systems, the default is /var/mqm/log. User ID mqm and group mqm must have full authority on these directories, which occurs automatically if the log fles are in their default locations. If we change the locations of these fles, we must give these authorities manually.
- -lf <LogFilePages>: The log data is held in a series of fles called log fles.
- -lp <LogPrimaryFiles>: The log fles allocated when the Queue Manager is created.
- -ls <LogSecondaryFiles>: The log fles allocated when the primary fles are exhausted.
- -q: Makes this Queue Manager the default Queue Manager.
- -t <IntervalValue>: The trigger time interval in milliseconds for all queues controlled by this Queue Manager. This value specifes the time after receiving a trigger-generating message when triggering is suspended. That is, if the arrival of a message on a queue causes a trigger message to be put on the Initiation Queue, any message arriving on the same queue within the specifed interval does not generate another trigger message.
- -u <DeadLetterQueue>: The name of the Local Queue that is to be used as the Dead Letter Queue. Messages are put on this queue if they cannot be routed to their correct destination. The default is no Dead Letter Queue.
- -x <MaxUMsgs>: The maximum number of uncommitted messages under any one syncpoint. The default value is 10,000 uncommitted messages.
- -z: Suppresses error messages. This fag is used within WebSphere MQ to suppress unwanted error messages. Because using this fag can result in loss of information, do not use it when entering commands through the command line.
The
command to create a Queue Manager called QMA with a Dead Letter Queue called
DEAD.LETTER.QUEUE.QMA is:
$ crtmqm –u DEAD.LETTER.QUEUE.QMA QMA
You
should see something similar to the following on your screen:
WebSphere
MQ queue manager created.
Creating
or replacing default objects for QMA.
Default
objects statistics : 43 created. 0 replaced. 0 failed.
Completing
setup.
Setup
completed.
Note
that this command just tells the Queue Manager that it can use a Dead Letter
Queue called DEAD.LETTER.QUEUE.QMA, which is a Local Queue, and still
has to be created, see the MQ Queue management—to defne a Local Queue section.
As we have not specifed any logging options, we will be using circular logging.
It
is not possible to change the type of logging once the Queue Manager has been
defned.
As
can be seen from the command description, the CRTMQM command has only a
small number of parameters that can be specifed. A Queue Manager has many more
attributes, and these are automatically set to default values. These default
values can be changed using the ALTER QMGR MQSC command. One such
parameter that is assigned when a Queue Manager is created is the SCHINIT
attribute, which controls channel initiators and is discussed next.
All
Queue Managers need a channel initiator to monitor the system-defined
initiation queue SYSTEM.CHANNEL.INITQ, which is the Initiation Queue for
all Transmission Queues.
When
we start a Queue Manager, a channel initiator is automatically started if the
Queue Manager attribute SCHINIT is set to QMGR (which is the
default value). Otherwise, it can be started using the START CHINIT MQSC
command or the RUNMQCHI command.