Some of the properties of a queue can be updated. Note that these are only those properties which are marked as writable in the above table. A similar technique is used to update and inquire upon other types of queues, such as remote and home server queues.
The parameter field object needs to be set with field elements that need to be updated.
Figure 27. Updating the properties of a queue in Java
/* Create an empty queue admin message and parameters field */ MQeQueueAdminMsg msg = new MQeQueueAdminMsg(); /** Prime message with who to reply to and a unique identifier * and set the name of the QueueManager and Queue */ MQeFields params = new MQeFields(); /* Add a new description for the queue */ msg.putAscii(MQeQueueAdminMsg.Queue_Descrpition,"New Description"); /* Set the admin action to update the queue */ msg.update( parms );
In a similar manner to creating the Queue, the parameter structure needs to be set with the details to update. For example, to update the description of the queue:
Figure 28. Updating the properties of a queue in C
MQeLocalQParms localQParms = LOCAL_Q_INIT_VAL; localQParms.queueDescription = hDescription; //MQeStringHndl localQParms.opFlags |= QUEUE_DESC_OP; rc = mqeAdministrator_LocalQueue_update(hAdministrator, &exceptBlk, hLocalQueueName, hLocalQMName, &localQParms); }