Steps to create the client

The basic steps to create a client are defined below. The MQe_Script commands to accompany these are provided along with any undefined variables in Sample script to create a client.
  1. Create a queue manager.
    Provide a name and disk location.
     mqe_script_qm –create –qmname $CLIENT –qmpath $PATH
  2. Start the queue manager.
    See the code example below.
    mqe_script_qm –load
  3. Create a connection definition to the gateway queue manager.
    The connection definition must have the same name as the gateway queue manager. Define the port on which the gateway is listening and, if the gateway is listening on an adapter other than the default, this must also be defined.
    mqe_script_condef –create –cdname $GATEWAYQM –port $PORT –address $ADDRESS
  4. Create a via connection definition to the MQ queue manager.
    The client must know about the MQ queue manager to put messages to its queues. A via connection can be created where the name of the connection is the MQ queue manager name and the via name is the gateway queue manager.
    mqe_script_condef –create –cdname $MQNAME –viaqmname $GATEWAYQM
  5. Create a remote queue definition to the bridge queue and add an alias.

    The name of the remote queue definition must match one of the bridge queues defined on the gateway. The queue manager name of the MQ queue manager must also be defined.

    To use multiple bridge queues, where the bridge queue name is not the same as the real MQ queue name, aliases must be used. An application can not use a bridge queue name on the gateway as the queue name of the MQ queue because that queue does not exist on the MQ queue manager.

    Also, the remote definition of the queue can not be called the real MQ queue name as that reference does not exist on the gateway queue manager. It is therefore useful to add the actual name of the MQ queue as an alias to the remote queue definition so that applications know exactly where the message should be sent to.
    mqe_script_sproxyq –create –qname $BRIDGEQ$BRIDGEQNUM  –destination $MQNAME –alias $REALBRIDGENAME
    When using MQe_Script, the alias can be added at the time of creation or as an update in a later stage if the remote queue definition already exists.
  6. Test the connection by sending a message from the client to the MQ queue manager.
    For applications to make the same call, independent of which client they are putting messages to, the message can be put using the alias of the remote queue definition.
    mqe_script_msg –put –qname $REALBRIDGENAME –qmname $MQNAME

Terms of use | WebSphere software

(c) Copyright IBM Corporation 2004, 2005. All rights reserved.