To add an alias name to a queue, use the addAlias method on the MQeQueueAdminMsg. With admin messages multiple add and remove alias operations can be done in one admin message.
Figure 27. Adding an alias to 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 */ /* Add a name that will be the alias of this queue */ msg.addAlias( "Fred" ); /* Set the admin action to update the queue */ msg.update( parms );