Temporary queues can be created dynamically in the program unit run by means of the KDCS call QCRE and deleted by means of the QREL call. No administration authorization is necessary for these calls.
Temporary queues are particularly suitable for communication between services: a service creates a temporary queue and passes the name of this queue with the asynchronous services it creates. The service subsequently reads the messages that these asynchronous services send to the temporary queue or waits for these messages. The temporary queue is then deleted again. When a new temporary queue is created, messages can be written to this queue in the same transaction. However, these messages cannot be read and administered until after the transaction is successfully completed.
The name of the temporary queue can either be freely selected or created automatically by openUTM. The advantage of having names created automatically by openUTM is that the names assigned are always new. Only after 100 million calls is the same name assigned again.
A temporary queue can be deleted at any time by means of the QREL call. On the successful completion of the transaction, all the messages in the queue are deleted and the name and table space of the queue are released. All services waiting for messages of the deleted queue are continued.
Time-controlled messages cannot be sent to temporary queues.
The maximum number of temporary queues that can be created is specified at the generation of the application (QUEUE statement, NUMBER operand: see also the openUTM manual “Generating Applications”). In the QUEUE statement it is also possible to limit the number of messages stored in the queue using the QLEV (queue level) operand; this allows you to limit the utilization of the page pool. However, you can also specify the queue level dynamically in the QCRE call. If you do this, anything specified at generation is overwritten.
A program unit can obtain the names of all the temporary queues and their properties by means of the KDCADMI call KC_GET_OBJECT (object type: KC_QUEUE).