A queue manager manages the resources associated with it, in particular the queues that it owns. It provides queuing services to applications for Message Queuing Interface (MQI) calls and commands to create, modify, display, and delete WebSphere MQ objects.
Before you can do anything with messages and queues, you must create and start at least one queue manager and its associated objects. To create a queue manager, use the WebSphere MQ control command crtmqm (described in crtmqm (create queue manager)). The crtmqm command automatically creates the required default objects and system objects (described in "System default objects"). Default objects form the basis of any object definitions that you make; system objects are required for queue manager operation. When you have created a queue manager and its objects, use the strmqm command to start the queue manager.
Note: | WebSphere MQ does not support machine names that contain spaces. If you install WebSphere MQ on a computer with a machine name that contains spaces, you cannot create any queue managers. |
Before you can create a queue manager, there are several points you need to consider (especially in a production environment). Work through the following checklist:
One way of ensuring uniqueness is to prefix each queue manager name with its own unique node name. For example, if a node is called ACCOUNTS, you can name your queue manager ACCOUNTS.SATURN.QUEUE.MANAGER, where SATURN identifies a particular queue manager and QUEUE.MANAGER is an extension you can give to all queue managers. Alternatively, you can omit this, but note that ACCOUNTS.SATURN and ACCOUNTS.SATURN.QUEUE.MANAGER are different queue manager names.
If you are using WebSphere MQ for communication with other enterprises, you can also include your own enterprise name as a prefix. This is not done in the examples, because it makes them more difficult to follow.
Note: | Queue manager names in control commands are case-sensitive. This means that you are allowed to create two queue managers with the names jupiter.queue.manager and JUPITER.queue.manager. However, it is better to avoid such complications. |
In production systems, many nodes are run with a single queue manager, but larger server machines might run with multiple queue managers.
Specifying a queue manager as the default replaces any existing default queue manager specification for the node.
Changing the default queue manage can affect other users or applications. The change has no effect on currently-connected applications, because they can use the handle from their original connect call in any further MQI calls. This handle ensures that the calls are directed to the same queue manager. Any applications connecting after you have changed the default queue manager connect to the new default queue manager. This might be what you intend, but you should take this into account before you change the default.
Creating a default queue manager is described in Creating a default queue manager.
It is important to have a dead-letter queue on each queue manager in your network. If you do not define one, errors in application programs might cause channels to be closed, and replies to administration commands might not be received.
For example, if 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.
The channels are not affected if the queue managers have dead-letter queues. The undelivered message is simply put on the dead-letter queue at the receiving end, leaving the channel and its transmission queue available.
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 to specify the dead-letter queue to be used. See Altering queue manager attributes for an example of the MQSC command ALTER.
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. See Working with local queues for more information.
In a development environment, the default logging parameters should be adequate. However, you can change the defaults if, for example:
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.
For more information about logging parameters, see Chapter 14, Recovery and restart.
These shared memory problems do not occur if the different logical volumes are created such that they have different minor device numbers.
You create a default queue manager using the crtmqm command with the -q flag. The following crtmqm command:
crtmqm -q -d MY.DEFAULT.XMIT.QUEUE -u SYSTEM.DEAD.LETTER.QUEUE SATURN.QUEUE.MANAGER
where:
Note: | WebSphere MQ does not create a default transmission queue for you; you have to define it yourself. |
The complete syntax of the crtmqm command is shown in crtmqm (create queue manager).
The system and default objects are listed in Appendix A, System and default objects.
For WebSphere MQ for UNIX systems only |
---|
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 (FFST(TM)) message. If the directory is not empty, a new directory is created. |
You can make an existing queue manager the default queue manager. The way you do this depends on the platform you are using.
On Windows systems, use the WebSphere MQ Services snap-in to display the properties of the queue manager, and check the Make queue manager the default box. You need to stop and restart the queue manager for the change to take effect.
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.
See Chapter 9, Configuring WebSphere MQ for information about configuration files.
When you have changed the configuration information, stop the queue manager and restart it. See Stopping a queue manager for information about how to do this.
WebSphere MQ configuration information is stored in the Registry for Windows systems, and in configuration files on UNIX systems.
If you use WebSphere MQ for Windows, configuration information is stored in the Windows Registry. Use the WebSphere MQ Services snap-in or the amqmdain command to make changes to the Registry.
There are two types of configuration file:
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.
For more information about configuration files, see Chapter 9, "Configuring WebSphere MQ".