Create a queue manager
Overview
Queue managers manage queue resources and provides queuing services to applications for MQI calls.
Use crtmqm to create queue managers and system default objects.
Use strmqm to start queue managers.
Queue manager names are case sensistive. Use uppercase names so that you can communicate with queue managers on all platforms. If you do have lowercase letters in the queue queue name, enclose the name in single quotes ('') when running commands.
Use a unique name for each queue manager. You will not get a warning if you create a queue manager that has the same name as another queue manager on your network. Include node, machine, and/or application names in the queue manager name to help ensure uniqueness. For example:
ACCOUNTS.SATURN.QUEUE.MANAGERBecause each queue manager requires its own resources, it is generally better to have one queue manager with 100 queues on a node than to have ten queue managers with ten queues each.
In production systems, many nodes are run with a single queue manager, but larger server machines might run with multiple queue managers.
Dead-letter queue
The dead-letter queue is a local queue where messages are put if they cannot be routed to their intended destination.
It is important to have a dead-letter queue on each queue manager in your network. If you do not define a dead-letter queue, and an application tries to put a message on a queue on another queue manager, but gives the wrong queue name, the channel is stopped and the message remains on the transmission queue. Other applications cannot then use this channel for their messages.
When you create a queue manager, use the -u flag to specify the name of the dead-letter queue. You can also use an MQSC command to alter the attributes of a queue manager that you have already defined.
Default transmission queue
A transmission queue is a local queue on which messages in transit to a remote queue manager are queued before transmission. The default transmission queue is the queue that is used when no transmission queue is explicitly defined. Each queue manager can be assigned a default transmission queue.
When you create a queue manager, use the -d flag to specify the name of the default transmission queue. This does not actually create the queue; you have to do this explicitly later on.
Logging parameters
Specify logging parameters on the crtmqm command, including the type of logging, and the path and size of the log files.
You can change the defaults if, for example:
- You have a low-end system configuration that cannot support large logs.
- You anticipate a large number of long messages being on your queues at the same time.
- You anticipate a lot of persistent messages passing through the queue manager.
Once you have set the logging parameters, some of them can only be changed by deleting the queue manager and re-creating it with the same name but with different logging parameters.
Multiple queue managers
If you install multiple queue managers with different logical volumes for each queue manager, the ftok function might cause shared memory problems. The ftok function calculates the shared memory key from the node and the minor number of the housing logical volume. On AIX, shared memory problems can occur if two queue managers are installed in an HACMP environment with different logical volumes that have identical minor device numbers.
These shared memory problems do not occur if the different logical volumes are created such that they have different minor device numbers.
Default queue manager
Each node should have a default queue manager, though it is possible to configure WebSphere MQ on a node without one. The default queue manager is used by MQSC commands when runmqsc is invoked without specifying a queue manager name.
Changing the default queue manager can affect other users or applications. Any applications connecting after you have changed the default queue manager connect to the new default queue manager.
You create a default queue manager using the crtmqm command with the -q flag:
crtmqm -q -d MY.DEFAULT.XMIT.QUEUE -u SYSTEM.DEAD.LETTER.QUEUE SATURN.QUEUE.MANAGERwhere:
-q Specifies that this queue manager is the default queue manager. -d MY.DEFAULT.XMIT.QUEUE Name of the default transmission queue to be used by this queue manager. WebSphere MQ does not create a default transmission queue for you; you have to define it yourself. -u SYSTEM.DEAD.LETTER.QUEUE Name of the default dead-letter queue created by WebSphere MQ on installation. SATURN.QUEUE.MANAGER Name of this queue manager. This must be the last parameter specified on the crtmqm command. You can create the queue manager directory /var/mqm/qmgrs/qmgr, even on a separate local file system, before you use the crtmqm command. When you use crtmqm, if the /var/mqm/qmgrs/qmgr directory exists, is empty, and is owned by mqm, it is used for the queue manager data. If the directory is not owned by mqm, the creation fails with a First Failure Support Technology message. If the directory is not empty, a new directory is created.
Make an existing queue manager the default
You can make an existing queue manager the default queue manager.
When you create a default queue manager, its name is inserted in the Name attribute of the DefaultQueueManager stanza in the WebSphere MQ configuration file (mqs.ini). The stanza and its contents are automatically created if they do not exist.
- To make an existing queue manager the default, change the queue manager name on the Name attribute to the name of the new default queue manager. You must do this manually, using a text editor.
- If you do not have a default queue manager on the node, and you want to make an existing queue manager the default, create the DefaultQueueManager stanza with the required name yourself.
- If you accidentally make another queue manager the default and want to revert to the original default queue manager, edit the DefaultQueueManager stanza in mqs.ini, replacing the unwanted default queue manager with that of the one you want.
When you have changed the configuration information, stop the queue manager and restart it.
Backing up configuration files after creating a queue manager
WebSphere MQ configuration information is stored in the Registry for Windows systems, and in configuration files on UNIX systems.
There are two types of configuration file:
- When you install the product, the WebSphere MQ configuration file (mqs.ini) is created. It contains a list of queue managers that is updated each time you create or delete a queue manager. There is one mqs.ini file per node.
- When you create a new queue manager, a new queue manager configuration file (qm.ini) is automatically created. This contains configuration parameters for the queue manager.
After creating a queue manager, we recommend that you back up your configuration files.
If, later on, you create another queue manager that causes you problems, you can reinstate the backups when you have removed the source of the problem. As a general rule, back up your configuration files each time you create a new queue manager.
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.