Client queue managers

A client typically runs on a device platform, and provides a queue manager that can be used by applications on the device. It can open many connections to other queue managers and, if configured with a peer connection can accept incoming requests from other queue managers.

Class Aliases

The aliases are not processed by the queue manager itself. The queue manager requires these aliases to have been processed prior to its activation as several of these aliases are required to allow the queue manager to activate properly. For example, queues must have a queue store adapter defined so that they have a storage area in which to hold their messages. MsgLog is the default queue store adapter, if this is not present then a MsgLog not found exception is thrown.

MQeRegistry parameters for the queue manager

The registry is the primary store for queue manager-related information; one exists for each queue manager. Every queue manager uses the registry to hold its:

Registry type

MQE_REGISTRY_LOCAL_REG_TYPE
The type of registry being opened. file registry and private registry are currently supported. A private registry is required for some of the security features. See Security.

For a file registry this parameter should be set to:

com.ibm.mqe.registry.MQeFileSession

For a private registry it should be set to:

com.ibm.mqe.registry.MQePrivateSession

Aliases can be used to represent these values.

File registry parameters

The following parameter is needed for a file registry:

MQE_REGISTRY_DIR_NAME
The name of the directory holding the registry files.

Private registry parameters

The following parameters can be used for a private registry.

MQE_REGISTRY_DIR_NAME
The name of the directory holding the registry files

MQE_REGISTRY_PIN
The PIN for the private registry

MQE_REGISTRY_KEY_RING_PASSWORD
The password or phrase used to protect the registry's private key

MQE_REGISTRY_CA_IP_ADDR_PORT
The address and port number of a mini-certificate server

MQE_REGISTRY_CERT_REQ_PIN
The certificate request number preallocated by the mini-certificate administrator to allow the registry to obtain its credentials

The first three parameters are always needed. The last two parameters are needed for auto-registration of the registry if it wishes to obtain its credentials from the mini-certificate server.

Note:
For security reasons, the PIN and KeyRingPassword, if supplied, are deleted from the startup parameters as soon as the queue manager has been activated.

For either type of registry MQE_REGISTRY_SEPARATOR is also needed if you want to use a non-default separator. The separator is the character that is used between the components of an entry name, for example:

<QueueManager><Separator><Queue>

This parameter is specified as a string but it should contain a single character. If it contains more than one only the first character is used.

You should use the same separator character every time a registry is opened. It should not be changed once a registry is in use.

If this parameter is not specified the separator defaults to '+'.

RegistryAdapter

MQeRegistry.RegistryAdapter (ascii)
The class, (or an alias that resolves to a class), of the adapter that the registry uses to store its data. This value should be included if you want the registry to use an adapter other than the default MQeDiskFieldsAdapter. Any valid adapter class can be used.

Starting a client queue manager

Starting a client queue manager involves:

  1. Adding any aliases to the system
  2. Enabling trace if required
  3. Starting the queue manager

The following code fragment starts a client queue manager:

MQERETURN createQueueManager(MQeExceptBlock *pErrorBlock, MQeQueueManagerHndl
 										*phQMgr, MQeFieldsHndl hInitFields, 
										 MQeStringHndl hQStore)
{
 
   MQERETURN rc;
   MQeQueueManagerConfigureHndl hQMgrConfigure;
 
      /* Create instance of QueueManagerConfigure Class */
      rc = mqeQueueManagerConfigure_new(pErrorBlock,&hQMgrConfigure,
														hInitFields,hQStore);
 
      if (MQERETURN_OK == rc) {
         /* define queue manager */
         rc = mqeQueueManagerConfigure_defineQueueManager(hQMgrConfigure, 
																					pErrorBlock);
         if (MQERETURN_OK == rc) {
            /* define system default queues */
            rc = mqeQueueManagerConfigure_defineDefaultSystemQueue
														(hQMgrConfigure, pErrorBlock, NULL);
         }
 
         /* close mqeQueueManagerConfigure */
         (void)mqeQueueManagerConfigure_close(hQMgrConfigure, NULL);
         if (MQERETURN_OK == rc) {
            /* create queue manager */
            rc = mqeQueueManager_new(pErrorBlock, phQMgr);
            if (MQERETURN_OK == rc) {
               rc = mqeQueueManager_activate(*phQMgr, pErrorBlock, hInitFields);
            } 
         }
         /* free mqeQueueManagerConfigure */
         (void)mqeQueueManagerConfigure_free(hQMgrConfigure, NULL);
      }
 
   return rc;
}

Once you have started the client, you can obtain a reference to the queue manager object by using API call mqeQueueManager_getReference(queueManagerName).



© IBM Corporation 2000, 2003. All Rights Reserved