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.
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.
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:
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.
The following parameter is needed for a file registry:
The following parameters can be used for a private registry.
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.
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 '+'.
Starting a client queue manager involves:
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).