Creating the gateway

This section provides the basic steps and code snippets to create a gateway. The MQe_Script commands used in this section are provided as a full script along with any undefined variables in Sample script to create a gateway.
  1. Create a queue manager.
    To create a basic queue manager, provide a name and disk location. The disk location is where the registry will be saved to and any messages for queues.
    mqe_script_qm -create -qmname $GATEWAYQM -qmpath $PATH
  2. Start the queue manager.
    The command used here does not specify a queue manager name to load. This is because if used directly after a create command, the queue manager details are cached. For more information on how to load a previously created queue manager, please see the documentation accompanying MQe_Script when you download the SupportPac™.
    mqe_script_qm –load
  3. Create a listener.
    The listener must be given a name and a port to listen on. Optionally, the type of adapter can be specified if it is something other than the default (TCPIP HTTP).
    mqe_script_listen -create -listenname $LISTENER -port $GATEWAYPORT
  4. Start the listener.
    By default listeners are not started after they are created. Once the queue manager has been stopped and restarted however, the listener will then start automatically.
    mqe_script_listen –start -listenname $LISTENER
  5. Create a bridge.
    An arbitrary name is needed for the bridge object. This acts as the parent for all the other bridge-related objects.
    mqe_script_bridge -create -bridgename $BRIDGE
  6. Create a queue manager proxy.
    The queue manager proxy must be associated with the bridge object previously created. It must also be named according to the name of the MQ queue manager with which the connection will take place. Finally, the IP address or hostname of the machine on which the MQ queue manager is defined is required.
    mqe_script_mqproxy -create -proxyname $PROXY -bridgename $BRIDGE -hostname $ADDRESS
  7. Create a connection definition to the MQ queue manager.
    A special MQ connection must be created to define the MQ queue manager. This needs to have the same name as the MQ queue manager.
    mqe_script_condef -create -cdname $PROXY -type mq
  8. Create multiple client connection channels.
    These must be associated with the queue manager proxy and bridge objects previously created. They must have the same name as a server connection channel on the MQ queue manager. Finally, the MQ sync queue, which it will use, must be defined. This will be different for each client connection channel. If the MQ queue manager is not listening on the default port of 1414, the port number must also be defined.
    mqe_script_mqconn -create -clientconnname $CC$j -proxyname $PROXY -bridgename $BRIDGE -syncqname 
        $SYNCQ$j -port $PORT
  9. Optionally, to receive messages back from MQ, create multiple transmission queue listeners.
    If a transmission queue listener is required, it must be associated with the client connection channel, queue manager proxy and bridge objects previously created. It must have the same name as the transmission queue on the MQ queue manager.
    mqe_script_mqlisten -create -listenname $LISTEN -clientconnname $CC$j -proxyname 
        $PROXY -bridgename $BRIDGE
  10. Create multiple bridge queues.
    A name must be provided for the bridge queue. Under normal circumstances, the bridge queue names reflect the name of the MQ destination queue. An alternative way of linking the bridge queue to the MQ queue is to use an additional parameter, the MQ Queue Name, which allows the name of the bridge queue to be something different. It is this latter approach that needs to be taken when defining multiple bridge queues. Each bridge queue must be associated with an individual client connection. In other words, there is a one-to-one relationship. The bridge queue also needs to be associated with the bridge and the queue manager proxy, thus linking the bridge queue to a specific MQ queue manager, queue and connection.
     mqe_script_bridgeq -create -qname $BRIDGEQ$j -bridgename $BRIDGE -destination $PROXY
         -mqqname $REALBRIDGEQ -clientconnname $CC$j
  11. Start the bridge.
    Starting the bridge will by default start all the child objects too. If you have created transmission queue listeners and your MQ queue manager is not contactable, this may result in the transmission queue listener failing to start. This is something to watch out for as the command may come back as successful even if all the child objects were not started. On the other hand, an error may be thrown and you may wish to ignore it and carry on with the script. Each of the child objects can be started individually if preferred.
    mqe_script_bridge -start -bridgename $BRIDGE

Terms of use | WebSphere software

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