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.
All parameters are required unless the description states they are optional.
In every case, QMgrName is the name of the queue manager to which the command applies.
| If no parameter is supplied: | Displays the status of the WebSphere MQ service. |
| If a QMgrName is supplied: | Displays the status of the named queue manager service. |
| If the parameter all is supplied: | Displays the status of all 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
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 NetBiosamqmdain 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.
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 *
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 |