Home
Defining an alias queue
The following command creates an alias queue:
DEFINE QALIAS (MY.ALIAS.QUEUE) TARGQ (YELLOW.QUEUE)This command redirects MQI calls that specify MY.ALIAS.QUEUE to the queue YELLOW.QUEUE. The command does not create the target queue; the MQI calls fail if the queue YELLOW.QUEUE does not exist at run time.
If you change the alias definition, we can redirect the MQI calls to another queue. For example:
ALTER QALIAS (MY.ALIAS.QUEUE) TARGQ (MAGENTA.QUEUE)This command redirects MQI calls to another queue, MAGENTA.QUEUE.
We can also use alias queues to make a single queue (the target queue) appear to have different attributes for different applications. You do this by defining two aliases, one for each application. Suppose there are two applications:
- Application ALPHA can put messages on YELLOW.QUEUE, but is not allowed to get messages from it.
- Application BETA can get messages from YELLOW.QUEUE, but is not allowed to put messages on it.
The following command defines an alias that is put enabled and get disabled for application ALPHA:
DEFINE QALIAS (ALPHAS.ALIAS.QUEUE) + TARGQ (YELLOW.QUEUE) + PUT (ENABLED) + GET (DISABLED)The following command defines an alias that is put disabled and get enabled for application BETA:
DEFINE QALIAS (BETAS.ALIAS.QUEUE) + TARGQ (YELLOW.QUEUE) + PUT (DISABLED) + GET (ENABLED)ALPHA uses the queue name ALPHAS.ALIAS.QUEUE in its MQI calls; BETA uses the queue name BETAS.ALIAS.QUEUE. They both access the same queue, but in different ways.
We can use the LIKE and REPLACE attributes when you define queue aliases, in the same way that you use these attributes with local queues.
Parent topic:
Working with alias queues
fa11340_
Home