|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Defining a listener by script |
« View previous topic :: View next topic » |
Author |
Message
|
n0ahz0rk |
Posted: Thu Sep 09, 2004 4:38 pm Post subject: Defining a listener by script |
|
|
 Novice
Joined: 08 Sep 2004 Posts: 12
|
Hi,
Reading through the MQ manuals, I found that you can start a listener from the command line with a command like:
runmqlsr -t tcp -m QUEUE.MANAGER -p 1414
for example. The listener is only active while this command line program is running. Is there a way to define a listener (other than through the GUI) to remain persistent, and start automatically ?
Thanks. |
|
Back to top |
|
 |
Robert |
Posted: Thu Sep 09, 2004 4:55 pm Post subject: |
|
|
Apprentice
Joined: 22 Aug 2002 Posts: 46 Location: Quebec, Canada
|
If you're in Windows, you can use the amqmdain command to create (plug in the Windows Registry) a listener definition.
Robert |
|
Back to top |
|
 |
n0ahz0rk |
Posted: Thu Sep 09, 2004 5:19 pm Post subject: |
|
|
 Novice
Joined: 08 Sep 2004 Posts: 12
|
Thanks Robert.... any syntax hints - or can you tell me which MQ manual would I find this in ??
Noah. |
|
Back to top |
|
 |
Robert |
Posted: Thu Sep 09, 2004 5:44 pm Post subject: |
|
|
Apprentice
Joined: 22 Aug 2002 Posts: 46 Location: Quebec, Canada
|
>>-amqmdain---+- start QMgrName-----------------+--------------><
+- end QMgrName-------------------+
+- auto QMgrName------------------+
+- manual QMgrName----------------+
+- crtlsr QMgrName LsrParams------+
+- crttrm QMgrName QueueName------+
+- crtchi QMgrName InitQName------+
+- status -+----------+-----------+
| +-QMgrName-+ |
| '-all------' |
+- cstmig filename----------------+
+- regsec ------------------------+
+- spn qmgrname-+-------+---------+
| +-set---+ |
| '-unset-' |
'- reg -+----------+---RegParams--'
+-QMgrName-+
'-*--------'
Keywords and parameters
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.
start QMgrName
Starts a queue manager service.
end QMgrName
Ends a queue manager service.
auto QMgrName
Sets a queue manager service to automatic startup.
manual QMgrName
Sets a queue manager service to manual startup.
crtlsr QMgrName 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 QMgrName 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 QMgrName 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 QMgrName 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 QMgrName | all
These parameters are optional.
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.
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 QMgrName set | unset
Allows you to set or unset the service principal name for a queue manager.
reg QMgrName | * 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 * |
|
Back to top |
|
 |
n0ahz0rk |
Posted: Thu Sep 09, 2004 5:51 pm Post subject: |
|
|
 Novice
Joined: 08 Sep 2004 Posts: 12
|
Thanks again...
That's quite comprehensive.  |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|