Friday, 22 January 2016

Queue managers

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. The crtmqm command automatically creates the required default objects and system objects.

Optional parameters
-c Text
 Descriptive text for this queue manager. You can use up to 64 characters; the default is all blanks. 

 -d DefaultTransmissionQueue
 The name of the local transmission queue where remote messages are put if a transmission queue is not explicitly defined for their destination. There is no default.

 -h MaximumHandleLimit
The maximum number of handles that any one application can have open at the same time.Specify a value in the range 1 through 999 999 999. The default value is 256.

-lc Use circular logging. This is the default logging method.
-ll Use linear logging.
-ld LogPath The directory used to hold log files.

-lf LogFilePages
The log data is held in a series of files called log files. The log file size is specified in units of 4 KB pages. In WebSphere MQ for UNIX systems, the default number of log file pages is 1024, giving a log file size of 4 MB. The minimum number of log file pages is 64 and the maximum is 65 535. 

Note: The size of the log files specified during queue manager creation cannot be changed for a queue manager.

-lp LogPrimaryFiles
The log files allocated when the queue manager is created. The minimum number of primary log files you can have is 2 and the maximum is 254 on Windows, or 510 on UNIX systems. The default is 3. The total number of primary and secondary log files must not exceed 255 on Windows, or 511 on UNIX systems, and must not be less than 3. Operating system limits can reduce the maximum possible log size. The value is examined when the queue manager is created or started. You can change it after the queue manager has been created. However, a change in the value is not effective until the queue manager is restarted, and the effect might not be immediate.

-ls LogSecondaryFiles

The log files allocated when the primary files are exhausted. The minimum number of secondary log files is 1 and the maximum is 253 on Windows, or 509 on UNIX systems. The default number is 2. The total number of primary and secondary log files must not exceed 255 on Windows, or 511 on UNIX systems, and must not be less than 3.

-q Makes this queue manager the default queue manager. The new queue manager replaces any existing default queue manager.

-u DeadLetterQueue
The name of the local queue that is to be used as the dead-letter (undelivered-message) queue. Messages are put on this queue if they cannot be routed to their correct destination.

Examples

1. This command creates a default queue manager called Paint.queue.manager, with a description of Paint shop, and creates the system and default objects. It also specifies that linear logging is to be used:

crtmqm -c "Paint shop" -ll -q Paint.queue.manager

 2. This command creates a default queue manager called Paint.queue.manager, creates the system and default objects, and requests two primary and three secondary log files:

 crtmqm -c "Paint shop" -ll -lp 2 -ls 3 -q Paint.queue.manager

Starting a queue manager

Starting a queue manager Although you have created a queue manager, it cannot process commands or MQI calls until you start it. You do this using the strmqm command as follows

strmqm Paint.queue.manager

Stopping a queue manager

Use the endmqm command to stop a queue manager

endmqm   Paint.queue.manager

Optional parameters

Quiesced shutdown

By default, the endmqm command performs a quiesced shutdown of the specified queue manager. This might take a while to complete. A quiesced shutdown waits until all connected applications have disconnected. Use this type of shutdown to notify applications to stop.

If you issue: endmqm -c Paint.queue.manager

 you are not told when all applications have stopped. (An : endmqm -c Paint.queue.manager
 command is equivalent to an : endmqm  Paint.queue.manager command.)

 However, if you issue: endmqm -w Paint.queue.manager the command waits until all applications have stopped and the queue manager has ended.

 Immediate shutdown

For an immediate shutdown any current MQI calls are allowed to complete, but any new calls fail. This type of shutdown does not wait for applications to disconnect from the queue manager. For an immediate shutdown, type:

 endmqm -i Paint.queue.manager

Preemptive shutdown

If an immediate shutdown does not work, you must resort to a preemptive shutdown, specifying the -p flag. For example:

endmqm -p Paint.queue.manager

This stops the queue manager immediately.

Deleting a queue manager

 To delete a queue manager, first stop it, then issue the following command:

dltmqm Paint.queue.manager

Notes: Deleting a queue manager is a drastic step, because you also delete all resources associated with the queue manager, including all queues and their messages and all object definitions. There is no displayed prompt that allows you to change your mind; when you press the Enter key all the associated resources are lost.

Optional parameters

 -z Suppresses error messages.

The following command deletes the queue manager Paint.queue.manager  and also suppresses any messages caused by the command.


dltmqm -z Paint.queue.manager

No comments: