How the name service works

If a queue definition specifies the Scope attribute as queue manager, that is, SCOPE(QMGR) in MQSC, the queue definition (along with all the queue attributes) is stored in the queue manager's directory only. This cannot be replaced by an installable service.

If a queue definition specifies the Scope attribute as cell, that is, SCOPE(CELL) in MQSC, the queue definition is again stored in the queue manager's directory, along with all the queue attributes. However, the queue and queue-manager name are also stored in a name service. If no service is available that can store this information, a queue with the Scope cell cannot be defined.

The directory in which the information is stored can be managed by the service, or the service can use an underlying service, for example, a DCE directory, for this purpose. In either case, definitions stored in the directory must persist, even after the component and queue manager have terminated, until they are explicitly deleted.

Notes:

  1. To send a message to a remote host's local queue definition (with a scope of CELL) on a different queue manager within a naming directory cell, you need to define a channel.

  2. You cannot get messages directly from the remote queue, even when it has a scope of CELL.

  3. No remote queue definition is required when sending to a queue with a scope of CELL.

  4. The naming service centrally defines the destination queue, although you still need a transmission queue to the destination queue manager and a pair of channel definitions. In addition, the transmission queue on the local system must have the same name as the queue manager owning the target queue, with the scope of cell, on the remote system.

    For example, if the remote queue manager has the name QM01, the transmission queue on the local system must also have the name QM01. See WebSphere MQ Intercommunication for further information.

Name service interface

A name service provides the following entry points for use by the queue manager:

MQZ_INIT_NAME
Initialize the name service component.

MQZ_TERM_NAME
Terminate the name service component.

MQZ_LOOKUP_NAME
Look up the queue-manager name for the specified queue.

MQZ_INSERT_NAME
Insert an entry containing the owning queue-manager name for the specified queue into the directory used by the service.

MQZ_DELETE_NAME
Delete the entry for the specified queue from the directory used by the service.

If there is more than one name service configured:

Do not have more than one component that supports the insert and delete functions. However, a component that only supports lookup is feasible, and could be used, for example, as the last component in the list to resolve any name that is not known by any other name service component to a queue manager at which the name can be defined.

In the C programming language the names are defined as function datatypes using the typedef statement. These can be used to prototype the service functions, to ensure that the parameters are correct.

The header file that contains all the material specific to installable services is cmqzc.h for the C language.

Apart from the initialization function (MQZ_INIT_NAME), which must be the component's main entry point, functions are invoked by the entry point address that the initialization function has added, using the MQZEP call.

The following examples of UNIX configuration file stanzas for the name service specify a name service component provided by the (fictitious) ABC company.

Figure 40. Name service stanzas in qm.ini (for UNIX systems)

# Stanza for name service
 Service:
    Name=NameService
    EntryPoints=5
 
# Stanza for name service component, provided by ABC
 ServiceComponent:
    Service=NameService
    Name=ABC.Name.Service
    Module=/usr/lib/abcname
    ComponentDataSize=1024
Note:On Windows systems, name service stanza information is stored in the Registry.


© IBM Corporation 1994, 2002. All Rights Reserved