Start the queue manager

The examples.helloworld.Configure program creates an image of the HelloWorldQM queue manager on disk.

Before a queue manager can be used, it must be instantiated in memory, and started. The start method in the example program does this.
  public void start() throws Exception {
      
        System.out.println("Starting the queue manager.");
    
          String queueManagerName = "HelloWorldQM";
          String baseDirectoryName =
            "./QueueManagers/" + queueManagerName;
    
          // Create all the configuration
        information needed to construct the
          // queue manager in memory.
          MQeFields config = new MQeFields();
    
         // Construct the queue manager section parameters.
          MQeFields queueManagerSection = new MQeFields();

          queueManagerSection.putAscii(MQeQueueManager.Name,
                queueManagerName);
          config.putFields(MQeQueueManager.QueueManager,
                queueManagerSection);

           // Construct the registry section parameters.
           // In this examples, we use a public registry.
          MQeFields registrySection = new MQeFields();

         registrySection.putAscii(MQeRegistry.Adapter, 
            "com.ibm.mqe.adapters.MQeDiskFieldsAdapter");
          registrySection.putAscii(MQeRegistry.DirName, 
                baseDirectoryName + "/Registry");
          
          config.putFields("Registry", registrySection);
      
          System.out.println("Starting the queue manager");
          myQueueManager = new MQeQueueManager();
          myQueueManager.activate(config);
          System.out.println("Queue manager started.");
      }
To start the queue manager, at a minimum you must know its name, location, and the adapter which should be used to read the queue manager's configuration information from its registry.

Activating the queue manager causes the configuration data from the disk to be read using the disk fields adapter, and the queue manager is then started and running, available for use.


Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.