Home

 

Options (MQLONG) - input

This parameter controls how the object is closed. Only permanent dynamic queues can be closed in more than one way, being either retained or deleted; these are queues whose DefinitionType attribute has the value MQQDT_PERMANENT_DYNAMIC (see the DefinitionType attribute described in Attributes for queues). The close options are summarized in Table 74.

One (and only one) of the following must be specified:

MQCO_NONE

No optional close processing required.

This must be specified for:

  • Objects other than queues

  • Predefined queues

  • Temporary dynamic queues (but only in those cases where Hobj is not the handle returned by the MQOPEN call that created the queue).

  • Distribution lists

In all the above cases, the object is retained and not deleted.

If this option is specified for a temporary dynamic queue:

  • The queue is deleted, if it was created by the MQOPEN call that returned Hobj; any messages that are on the queue are purged.

  • In all other cases the queue (and any messages on it) are retained.

If this option is specified for a permanent dynamic queue, the queue is retained and not deleted.

On z/OS, if the queue is a dynamic queue that has been logically deleted, and this is the last handle for it, the queue is physically deleted. See MQCLOSE usage notes for further details.

MQCO_DELETE

The queue is deleted if either of the following is true:

  • It is a permanent dynamic queue, and there are no messages on the queue and no uncommitted get or put requests outstanding for the queue (either for the current task or any other task).

  • It is the temporary dynamic queue that was created by the MQOPEN call that returned Hobj. In this case, all the messages on the queue are purged.

In all other cases the call fails with reason code MQRC_OPTION_NOT_VALID_FOR_TYPE, and the object is not deleted.

On z/OS, if the queue is a dynamic queue that has been logically deleted, and this is the last handle for it, the queue is physically deleted. See MQCLOSE usage notes for further details.

MQCO_DELETE_PURGE

The queue is deleted, and any messages on it purged, if either of the following is true:

  • It is a permanent dynamic queue and there are no uncommitted get or put requests outstanding for the queue (either for the current task or any other task).

  • It is the temporary dynamic queue that was created by the MQOPEN call that returned Hobj.

In all other cases the call fails with reason code MQRC_OPTION_NOT_VALID_FOR_TYPE, and the object is not deleted.

Table 74. Effect of MQCLOSE options on various types of object and queue This table shows which close options are valid, and whether the object is retained or deleted.
Type of object or queue MQCO_NONE MQCO_DELETE MQCO_DELETE_PURGE
Object other than a queue Retained Not valid Not valid
Predefined queue Retained Not valid Not valid
Permanent dynamic queue Retained Deleted if empty and no pending updates Messages deleted; queue deleted if no pending updates
Temporary dynamic queue (call issued by creator of queue) Deleted Deleted Deleted
Temporary dynamic queue (call not issued by creator of queue) Retained Not valid Not valid
Distribution list Retained Not valid Not valid


 

Home