Inquiring about and setting object attributes
Attributes are the properties that define the characteristics of an IBM MQ object.
They affect the way that a queue manager processes an object. The attributes of each type of IBM MQ object are described in detail in Attributes of objects.
Some attributes are set when the object is defined, and can be changed only by using the IBM MQ commands; an example of such an attribute is the default priority for messages put on a queue. Other attributes are affected by the operation of the queue manager and can change over time; an example is the current depth of a queue.
We can inquire about the current values of most attributes using the MQINQ call. The MQI also provides an MQSET call with which we can change some queue attributes. We cannot use the MQI calls to change the attributes of any other type of object. Instead we must use one of the following resources:- The MQSC facility, which is described in MQSC commands.
- The CHGMQMx CL commands, which are described in CL commands reference for IBM i, or the MQSC facility.
- The ALTER operator commands, or the DEFINE commands with the REPLACE option, which are described in MQSC commands.
Note: The names of the attributes of objects are shown in this documentation in the form that we use them with the MQINQ and MQSET calls. When we use IBM MQ commands to define, alter, or display the attributes, we must identify the attributes using the keywords shown in the descriptions of the commands in the topic links.
Both the MQINQ and the MQSET calls use arrays of selectors to identify those attributes that we want to inquire about or set. There is a selector for each attribute that we can work with. The selector name has a prefix, determined by the nature of the attribute:
Prefix | Description |
---|---|
MQCA_ | These selectors refer to attributes that contain character data (for example, the name of a queue). |
MQIA_ | These selectors refer to attributes that contain either numeric values (such as CurrentQueueDepth, the number of messages on a queue) or a constant value (such as SyncPoint, whether the queue manager supports syncpoints). |
Before we use the MQINQ or MQSET calls the application must be connected to the queue manager, and we must use the MQOPEN call to open the object for setting or inquiring about attributes. These operations are described in Connect to and disconnecting from a queue manager and Opening and closing objects.
Use the following links to find out more about getting inquiring about and setting object attributes:- Inquiring about the attributes of an object
- Some cases where the MQINQ call fails
- Set queue attributes
- Inquiring about the attributes of an object
Use the MQINQ call to inquire about the attributes of any type of IBM MQ. - Some cases where the MQINQ call fails
If you open an alias to inquire about its attributes, we are returned the attributes of the alias queue (the IBM MQ object used to access another queue), not those of the base queue. - Set queue attributes
Use this information to learn how to set queue attributes using the MQSET call.
Parent topic: Writing a procedural application for queuing
Related concepts
- The Message Queue Interface overview
- Connect to and disconnecting from a queue manager
- Opening and closing objects
- Put messages on a queue
- Getting messages from a queue
- Committing and backing out units of work
- Starting IBM MQ applications using triggers
- Work with the MQI and clusters
- Use and writing applications on IBM MQ for z/OS
- IMS and IMS bridge applications on IBM MQ for z/OS