Sun Java System Message Queue 3.7 UR1 Administration Guide

Using Command Files

The -i option to the imqobjmgr command allows you to specify the name of a command file that uses Java property file syntax to represent all or part of the subcommand clause. This feature is especially useful for specifying object store attributes, which typically require a lot of typing and are likely to be the same across multiple invocations of imqobjmgr. Using a command file can also allow you to avoid exceeding the maximum number of characters allowed for the command line.

Example 8–9 shows the general syntax for an Object Manager command file. Note that the version property is not a command line option: it refers to the version of the command file itself (not that of the Message Queue product) and must be set to the value 2.0 .

Example 8–9 Object Manager Command File Syntax

cmdtype=[ add | delete | list | query | update ]
obj.lookupName=lookup name
   . . .
obj.type=[ q | t | cf | qf | tf | xcf | xqf | xtf | e ]
   . . .

As an example, consider the Object Manager command shown earlier in Example 8–1, which adds a queue connection factory to an LDAP object store. This command can be encapsulated in a command file as shown in Example 8–10. If the command file is named MyCmdFile, you can then execute the command with the command line

imqobjmgr -i MyCmdFile

Example 8–10 Example Command File


A command file can also be used to specify only part of the imqobjmgr subcommand clause, with the remainder supplied explicitly on the command line. For example, the command file shown in Example 8–11 specifies only the attribute values for an LDAP object store.

Example 8–11 Partial Command File


You could then use this command file to specify the object store in an imqobjmgr command while supplying the remaining options explicitly, as shown in Example 8–12.

Example 8–12 Using a Partial Command File

imqobjmgr add
   -l "cn=myQCF"
   -i MyCmdFile
   -t qf
   -o "imqAddressList=mq://myHost:7272/jms"

Additional examples of command files can be found at the following locations, depending on your platform:

Solaris: /usr/demo/imq/imqobjmgr Linux: /opt/sun/mq/examples/imqobjmgr Windows: IMQ_HOME/demo/imqobjmgr