|Skip Navigation Links|
|Exit Print View|
|Oracle GlassFish Server Message Queue 4.5 Administration Guide|
The Message Queue Object Manager utility (imqobjmgr) allows you to create and manage administered objects. The imqobjmgr command provides the following subcommands for performing various operations on administered objects:
Add an administered object to an object store
Delete an administered object from an object store
List existing administered objects in an object store
Display information about an administered object
Modify the attributes of an administered object
See Object Manager Utility for reference information about the syntax, subcommands, and options of the imqobjmgr command.
This is the logical name by which client applications can look up the administered object in the object store, using the Java Naming and Directory Interface.
See Object Stores for information on the possible attributes and their values.
The type (-t) of the administered object
Possible types include the following:
Queue connection factory
Topic connection factory
Connection factory for distributed transactions
Queue connection factory for distributed transactions
Topic connection factory for distributed transactions
The attributes (-o) of the administered object
See Administered Object Attributes for information on the possible attributes and their values.
When using imqobjmgr utility to connect to a secured LDAP server that uses the ldaps protocol, you might first have to install the LDAP server's certificate in the JDK keystore. To perform this task, use the Java SE keytool utility; for example:
keytool -import -keystore IMQ_JAVAHOME/lib/security/jssecacerts -alias "ldaps cert" -file certFile
where certFile is the certificate file from the LDAP server.
Then, when you run the imqobjmgr utility, make sure to specify the same Java installation where the certificate was imported; for example:
imqobjmgr -javahome IMQ_JAVAHOME ...
The imqobjmgr command’s add subcommand adds administered objects for connection factories and topic or queue destinations to the object store. Administered objects stored in an LDAP object store must have lookup names beginning with the prefix cn=; lookup names in a file-system object store need not begin with any particular prefix, but must not include the slash character (/).
Note - The Object Manager lists and displays only Message Queue administered objects. If an object store contains a non–Message Queue object with the same lookup name as an administered object that you wish to add, you will receive an error when you attempt the add operation.
To enable client applications to create broker connections, add a connection factory administered object for the type of connection to be created: a queue connection factory or a topic connection factory, as the case may be. Example 11-1 shows a command to add a queue connection factory (administered object type qf) to an LDAP object store. The object has lookup name cn=myQCF and connects to a broker running on host myHost at port number 7272, using the jms connection service.
Example 11-1 Adding a Connection Factory
When creating an administered object representing a destination, it is good practice to create the physical destination first, before adding the administered object to the object store. Use the Command utility (imqcmd) to create the physical destination, as described in Creating and Destroying Physical Destinations.
The command shown in Example 11-2 adds an administered object to an LDAP object store representing a topic destination with lookup name myTopic and physical destination name physTopic. The command for adding a queue destination would be similar, except that the administered object type (-t option) would be q (for “queue destination”) instead of t (for “topic destination”).
Example 11-2 Adding a Destination to an LDAP Object Store
Example 11-3 shows the same command, but with the administered object stored in a Solaris file system instead of an LDAP server.
Example 11-3 Adding a Destination to a File-System Object Store
To delete an administered object from the object store, use the imqobjmgr delete subcommand, specifying the lookup name, type, and location of the object to be deleted. The command shown in Example 11-4 deletes the object that was added in Adding a Destination above.
Example 11-4 Deleting an Administered Object
You can use the imqobjmgr list subcommand to get a list of all administered objects in an object store or those of a specific type. Example 11-5 shows how to list all administered objects on an LDAP server.
Example 11-5 Listing All Administered Objects
Example 11-6 lists all queue destinations (type q).
Example 11-6 Listing Administered Objects of a Specific Type
The imqobjmgr query subcommand displays information about a specified administered object, identified by its lookup name and the attributes of the object store containing it. Example 11-7 displays information about an object whose lookup name is cn=myTopic.
Example 11-7 Viewing Administered Object Information
To modify the attributes of an administered object, use the imqobjmgr update subcommand. You supply the object’s lookup name and location, and use the -o option to specify the new attribute values.
Example 11-8 Modifying an Administered Object’s Attributes
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 11-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 11-9 Object Manager Command File Syntax
As an example, consider the Object Manager command shown earlier in Example 11-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 11-10. If the command file is named MyCmdFile, you can then execute the command with the command lineimqobjmgr -i MyCmdFile
Example 11-10 Example Command File
A command file can also be used to specify only part of the imqobjmgr subcommand clause, with the remainder supplied directly on the command line. For example, the command file shown in Example 11-11 specifies only the attribute values for an LDAP object store.
Example 11-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 11-12.
Example 11-12 Using a Partial Command File
Additional examples of command files can be found in the IMQ_HOME/examples/imqobjmgr directory.