Java

The basic steps required to delete a queue manager are:

  1. Use the administration interface to delete any definitions
  2. Create and activate an instance of MQeQueueManagerConfigure
  3. Delete the standard queue and queue manager definitions
  4. Close the MQeQueueManagerConfigure instance

When these steps are complete, the queue manager is deleted and can no longer be run. The queue definitions are deleted, but the queues themselves are not deleted. Any messages remaining on the queues are inaccessible.

Note:
If there are messages on the queues they are not automatically deleted. Your application programs should include code to check for, and handle, remaining messages before deleting the queue manager.

1. Delete any definitions

You can use MQeQueueManagerConfigure to delete the standard queues that you created with it. You should use the administration interface to delete any other queues before you call MQeQueueManagerConfigure.

2. Create and activate an instance of MQeQueueManagerConfigure

This process is the same as when creating a queue manager.

3. Delete the standard queue and queue manager definitions

Delete the default queues by calling:

These methods work successfully even if the queues do not exist.

Delete the queue manager definition by calling deleteQueueManagerDefinition()

	
	import com.ibm.mqe.*;
	import examples.queuemanager.MQeQueueManagerUtils;
	try
	{
	 MQeQueueManagerConfigure qmConfig;
	 MQeFields parms = new MQeFields();
 	// initialize the parameters
 	...
 	// Establish any aliases defined by the .ini file
 	MQeQueueManagerUtils.processAlias(parms);
	qmConfig = new MQeQueueManagerConfigure( parms );
 	qmConfig.deleteAdminQueueDefinition();
 	qmConfig.deleteAdminReplyQueueDefinition();
 	qmConfig.deleteDeadLetterQueueDefinition();
 	qmConfig.deleteSystemQueueDefinition();
 	qmConfig.deleteQueueManagerDefinition();
 	qmconfig.close();
	}
	catch (Exception e)
	{ ... }
 

You can delete the default queue and queue manager definitions together by calling deleteStandardQMDefinitions(). This method is provided for convenience and is equivalent to:

	deleteDeadLetterQueueDefinition();
	deleteSystemQueueDefinition();
	deleteAdminQueueDefinition();
	deleteAdminReplyQueueDefinition();
	deleteQueueManagerDefinition();
	
 

4. Close the MQeQueueManagerConfigure instance

When you have deleted the queue and queue manager definitions, you can close the MQeQueueManagerConfigure instance.

The complete example looks like this:

	import com.ibm.mqe.*;
	import examples.queuemanager.MQeQueueManagerUtils;
	try
	{
 	MQeQueueManagerConfigure qmConfig;
 	MQeFields parms = new MQeFields();
 	// initialize the parameters
 	...
	 // Establish any aliases defined by the .ini file
 	MQeQueueManagerUtils.processAlias(parms);
 	qmConfig = new MQeQueueManagerConfigure( parms );
 	qmConfig.deleteStandardQMDefinitions();
 	qmconfig.close();
	}
	catch (Exception e)
	{ ... }
 


© IBM Corporation 2002. All Rights Reserved