amqmdain (WebSphere MQ services control)

 

Purpose

The amqmdain command applies to WebSphere MQ for Windows only.

Use amqmdain to configure or control WebSphere MQ Services, as an alternative to using the WebSphere MQ Services snap-in. Starting a queue manager service with amqmdain is not the same as using strmqm from the command line, because WebSphere MQ Services execute in a non-interactive session, running under a different user account. You can also configure a queue manager service to start associated processes, such as listeners and trigger monitors, or to ensure that any registry entries you have edited manually are assigned the correct security permissions.

 

Syntax

>>-amqmdain--+- start queue_manager--------------+------------------><
             +- end queue_manager----------------+
             +- auto queue_manager---------------+
             +- manual queue_manager-------------+
             +- crtlsr queue_manager LsrParams---+
             +- crttrm queue_manager QueueName---+
             +- crtchi queue_manager InitQName---+
             +- status -+----------+--------+
             |          +-queue_manager-+        |
             |          '-all------'        |
             +- cstmig filename-------------+
             +- regsec ---------------------+
             +- spn qmgrname-+-------+------+
             |               +-set---+      |
             |               '-unset-'      |
             '- reg -+----------+-RegParams-'
                     +-queue_manager-+
                     '-*--------'
 
 

 

Keywords and parameters

All parameters are required unless the description states they are optional.

In every case, queue_manager is the name of the queue manager to which the command applies.

start queue_manager
Starts a queue manager service.

end queue_manager
Ends a queue manager service.

auto queue_manager
Sets a queue manager service to automatic startup.

manual queue_manager
Sets a queue manager service to manual startup.

crtlsr queue_manager LsrParams
Creates a listener service for a queue manager.

LsrParams
Parameters applicable to the runmqlsr command, for example -t trptype -p Port. The parameters must be in pairs, but the -m queue_manager parameter is not required, because it is specified by the preceding parameter to the crtlsr keyword. See runmqlsr (run listener) for a complete description of the runmqlsr command.

crttrm queue_manager QueueName
Creates a trigger monitor service for a queue manager.

QueueName
The name of the queue to be used by the trigger monitor service. See runmqtmc (start client trigger monitor) for a complete description of the runmqtrm command.

crtchi queue_manager InitQName
Creates a channel initiator service for a queue manager.

InitQName
The name of the initiation queue to be used by the channel initiator. See runmqchl (run channel) for a complete description of the runmqchi command.

status queue_manager | all
These parameters are optional.

> If no parameter is supplied: Displays the status of the WebSphere MQ service.
> If a queue_manager is supplied: Displays the status of the named queue manager service.
> If the parameter all is supplied: Displays the status of all services.

cstmig filename
Imports definitions of custom services.

amqmdain loads custom services from a comma-separated value configuration file. amqmdain must be executed to store the custom service parameters in the Registry, add the key and values in the correct place, and to assign the appropriate security permissions to the Registry.

The format of an entry in the configuration file is:

Command Name, Start Command, End Command, Flags, Reserved

For example:

PubSub Broker, strmqbrk -p blue.queue.manager, endmqbrk -i 
  -m blue.queue.manager, SUFFIX|ROOT|STARTUP|SHUTDOWN|COMMAND, 1

regsec
Ensures that the security permissions assigned to the Registry keys are correct.

spn queue_manager set | unset
Allows you to set or unset the service principal name for a queue manager.

reg queue_manager | * RegParams
Modifies some WebSphere MQ attributes in the Windows Registry.

RegParams specifies the Registry stanzas to change and the changes to make. It takes one of the following forms:

-c add -s stanza -v attribute=value
-c remove -s stanza -v [attribute|*]
-c display -s stanza -v [attribute|*]

When you specify *, the valid values for stanza are:

ApiExitCommon\name
ApiExitTemplate\name
ACPI
AllQueueManagers
Channels
DefaultQueueManager
LogDefaults

When you specify a particular queue manager, the valid values for stanza are:

XAResourceManager\name
ApiExitLocal\name
Channels
ExitPath
Log
QueueManagerStartup
TCP
LU62
SPX
NetBios
amqmdain does not validate any name, attribute, or value you specify.

When you specify add, and an attribute already exists, it is modified. If a stanza does not exist, amqmdain creates it.

When you specify remove or display, you can use the value * to remove or display all attributes. If you use remove to delete the last attribute in a stanza, the stanza itself is deleted.

Any modification you make to the Registry re-secures all WebSphere MQ Registry entries.

 

Examples

The following example adds an XAResourceManager to queue manager TEST. The commands issued are:

amqmdain reg TEST -c add -s XAResourceManager\Sample -v SwitchFile=sf1
amqmdain reg TEST -c add -s XAResourceManager\Sample -v ThreadOfControl=THREAD
amqmdain reg TEST -c add -s XAResourceManager\Sample -v XAOpenString=openit
amqmdain reg TEST -c add -s XAResourceManager\Sample -v XACloseString=closeit

To display the values set by the commands above, use:

amqmdain reg TEST -c display -s XAResourceManager\Sample -v *

The display would look something like this:

0784726, 5639-B43 (C) Copyright IBM Corp. 1994, 2002. ALL RIGHTS RESERVED.
Displaying registry value for Queue Manager 'TEST'
        Attribute = Name, Value = Sample
        Attribute = SwitchFile, Value = sf1
        Attribute = ThreadOfControl, Value = THREAD
        Attribute = XAOpenString, Value = openit
        Attribute = XACloseString, Value = closeit   

To remove the XAResourceManager from queue manager TEST, use:

amqmdain reg TEST -c remove -s XAResourceManager\Sample -v *

 

Return codes


0 Command completed normally
-2 Syntax error
-3 Failed to initialize COM library
-4 Failed to initialize COM components
-5 Failed to create channel initiator
-6 Failed to create service
-7 Failed to configure service
-8 Invalid port type specified for crtlsr
-9 Unexpected Registry error

 

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.