Example of using multiple components

Suppose you create two a name services components called ABC_name_serv and XYZ_name_serv.

ABC_name_serv
This component supports inserting a name in, or deleting a name from, the service directory, but does not support looking up a queue name.
XYZ_name_serv
This component supports looking up a queue name, but does not support inserting a name in, or deleting a name from, the service directory.

What the components do

Component ABC_name_serv holds a database of queue names, and uses two simple algorithms to either insert, or delete, a name from the service directory.

Component XYZ_name_serv uses a simple algorithm that returns a fixed queue-manager name for any queue name with which it is invoked. It does not hold a database of queue names, and therefore does not support the insert and delete functions.

How the component is used

The components are installed on the same queue manager. The ServiceComponent stanzas are ordered so that component ABC_name_serv is invoked first. Any calls to insert or delete a queue in a component directory are handled by component ABC_name_serv; it is the only one that implements these functions. However, a lookup call that component ABC_name_serv cannot resolve is passed on to the lookup-only component, XYZ_name_serv. This component supplies a queue-manager name from its simple algorithm.