Connections define how to connect one queue manager to another queue manager. Once a connection has been defined, it is possible for a queue manager to put messages to queues on the remote queue manager. The following diagram shows the constituent parts that are required for a remote queue on one queue manager to communicate with a queue on a different queue manager:
Figure 13. Queue manager connections
Communication happens at different levels:
The connection and adapter are specified as part of a connection definition. The transporter is specified as part of a remote queue definition.
To create a suitable Connection Admin Msg, use the primeAdminMsg function shown in the Example files Admin-Ex1. Set the Remote Queue Manager name, using the mqeAdminMsg_setName function, and then call the mqeConnectionAdminMsg_create function.
To add a connection :
WebSphere MQ Everyplace provides a choice of connection and adapter types. Depending on the selection, queue managers can be connected in the following ways:
In a client to server configuration, one queue manager acts as a client and the other runs in a server environment. A server allows multiple simultaneous incoming connections. To accomplish this the server must have components that can handle multiple incoming requests. See Server queue managers for a description of how to run a queue manager in a server environment.
Figure 14 shows the typical connection components in a client to server configuration.
Figure 14. Client to server connections
You use MQeConnectionAdminMsg to configure the client portion of a connection. The connection type is com.ibm.mqe.MQeChannel. Normally an alias of DefaultChannel is configured for MQeChannel.
Create a connection, as described previously and then use the standard putMessage calls to send the message to the administration queue.
You can set up a connection so that a queue manager routes messages through an intermediate queue manager. This requires two connections:
The first connection is created by the functions described earlier in this section, either as a client or as a peer connection. For the second connection, the name of the intermediate queue manager is specified in place of the network adapter name. With this configuration an application can put messages to the target queue manager but route them through one or more intermediate queue managers.
You can assign multiple names or aliases to a connection (see Class Aliases). When an application calls functions on the MQeQueueManager class that require a queue manager name be specified, it can also use an alias.
You can alias both local and remote queue managers. To alias a local queue manager, you must first establish a connection definition with the same name as the local queue manager. This is a logical connection that can have all parameters set to null.
To add and remove aliases use the MQE_ADMIN_ACTION_ADDALIAS and MQE_ADMIN_ACTION_REMOVEALIAS actions of the MQeConnectionAdminMsg class. You can add or remove multiple aliases in one message. Put the aliases that you want to manipulated directly into the message by setting the ascii array field Con_Aliases. Alternatively you can use the two functions addAlias() or removeAlias(). Each of these functions takes one alias name but you can call the function repeatedly to add multiple aliases to a message.