changing queue attributes, queues, commands to use, local queues, local queue attributes, changing, message length, decreasing" />
Changing local queue attributes
We can change queue attributes in two ways, using either the CHGMQMQ command or the CPYMQMQ command with the REPLACE *YES attribute. In Defining a local queue, we defined the queue orange.local.queue. Suppose, for example, you wanted to increase the maximum message length on this queue to 10 000 bytes.
- Using the CHGMQMQ command:
CHGMQMQ QNAME('orange.local.queue') MQMNAME(MYQUEUEMANAGER) MAXMSGLEN(10000)This command changes a single attribute, that of the maximum message length; all the other attributes remain the same.- Using the CRTMQMQ command with the REPLACE *YES option, for example:
CRTMQMQ QNAME('orange.local.queue') QTYPE(*LCL) MQMNAME(MYQUEUEMANAGER) MAXMSGLEN(10000) REPLACE(*YES)This command changes not only the maximum message length, but all the other attributes, which are given their default values. The queue is now put enabled whereas previously it was put inhibited. Put enabled is the default, as specified by the queue SYSTEM.DEFAULT.LOCAL.QUEUE, unless you have changed it.
If you decrease the maximum message length on an existing queue, existing messages are not affected. Any new messages, however, must meet the new criteria.