You create the MQeQueueManagerConfigure object by calling the mqeQueueManagerConfigure_new method. Apart from the ExceptionBlock and the new MQeQueueManagerConfigure Handle, this method takes two additional parameters.
The method of operation depends on these parameters. "NULL" can be passed for these parameters, in which case mqeQueueManagerConfigure_activate is called immediately after mqeQueueManagerConfigure_new. Alternatively startup parameters can be passed.
try { MQeQueueManagerConfigure qmConfig; MQeFields parms = new MQeFields(); // initialize the parameters qmConfig = new MQeQueueManagerConfigure( ); qmConfig.activate( parms, "MsgLog:qmName\\Queues\\" ); } catch (Exception e) { … }
try { MQeQueueManagerConfigure qmConfig; MQeFields parms = new MQeFields(); // initialize the parameters qmConfig = new MQeQueueManagerConfigure( parms, "MsgLog:qmName\\Queues\\" ); } catch (Exception e) { … }
The directory name is stored as part of the queue manager definition and is used as a default value for the queue store in any future queue definitions. The directory does not have to exist and will be created when needed.
import com.ibm.mqe.*; import com.ibm.mqe.registry.*; import examples.queuemanager.MQeQueueManagerUtils; try { MQeQueueManagerConfigure qmConfig; MQeFields parms = new MQeFields(); // initialize the parameters MQeFields qmgrFields = new MQeFields(); MQeFields regFields = new MQeFields(); // Queue manager name is needed qmgrFields.putAscii(MQeQueueManager.Name, "qmName"); // Registry information regFields.putAscii(MQeRegistry.LocalRegType, "com.ibm.mqe.registry.MQeFileSession"); regFields.putAscii(MQeRegistry.DirName, "qmname\\Registry"); // add the embedded MQeFields objects parms.putFields(MQeQueueManager.QueueManager, qmgrFields); parms.putFields(MQeQueueManager.Registry, regFields); // activate the configure object qmConfig = new MQeQueueManagerConfigure( parms, "MsgLog:qmName\\Queues\\" ); } catch (Exception e) { … }
The example code includes creating an instance of MQeQueueManagerConfigure.