Example remove queue rule

The next example rule is called when a queue manager administration request tries to remove a queue. The rule is passed an object reference to the proxy for the queue in question. In this example, the rule checks the name of the queue that is passed, and if the queue is named PayrollQueue, the request to remove the queue is refused.
Java codebase
/* This rule prevents the removal of the Payroll Queue */
public void removeQueue( MQeQueueProxy queue ) 
throws Exception    {
    if ( queue.getQueueName().equals( "PayrollQueue" ) )    {
        throw new MQeException( Except_Rule, 
                    "Can't delete this queue" );
    }
}
C codebase
This rule is not implemented in the C codebase.

Parent topic: Using queue manager rules