Creating a simple queue manager in C

Stage 1: Create the admin components
All local administration actions can be accomplished using the MQeAdministrator. This allows you to create new QueueManagers and new Queues, and perform many other actions. For all calls, a pointer to the exception block is required, along with a pointer for the QueueManager handle.

Stage 2: Create a QueueManager
To create a QueueManager, two parameters structures are required. One contains the parameters for the QueueManager, the other for the registry. In this simple case the default values are suitable, with the addition of the location of the registry and queue store.

The call to the administrator will create the QueueManager. Note that the QueueManager name is passed into the call. A QueueManager Hndl is returned.

   if ( MQERETURN_OK == rc ) {
 
      MQeQueueManagerParms qmParams  = QMGR_INIT_VAL;
      MQeRegistryParms     regParams = REGISTRY_INIT_VAL;
 
      qmParams.hQueueStore           = hQueueStore;
      qmParams.opFlags               = QMGR_Q_STORE_OP;
      regParams.hBaseLocationName    = hRegistryDir;
      
      display("Creating the Queue Manager\n");
      rc = mqeAdministrator_QueueManager_create(hAdministrator,
                                                &exceptBlk,
                                                &hQueueManager,
                                                hLocalQMName,
                                                &qmParams,
                                                &regParams);
 
   }

Figure 19. Create queue manager C example



© IBM Corporation 2002, 2003. All Rights Reserved