Setting up a sender workstation

Use the following steps to set up the sender machine:
  1. Create a default queue manager called QMA. At a command prompt in a window, enter the following command:
    crtmqm -q QMA

    The -q option specifies that this queue manager is the default queue manager.

    Messages tell you that the queue manager is created, and that the default WebSphere® MQ objects are created.
  2. Start the default queue manager. Enter the following command:
    strmqm
    A message tells you when the queue manager starts.
  3. Enable MQSC commands. Enter the following command:
    runmqsc
    The message Starting WebSphere MQ Commands is displayed when MQSC has started. MQSC has no command prompt.
  4. In the MQSC command window, define a local queue to use as a transmission queue called QMA. Enter the following command:
    define qlocal(QMA) usage(xmitq)
    The message WebSphere MQ queue created is displayed when the queue is created.
  5. In the MQSC command window, create a local definition of the remote queue. Enter the following command:
    define qremote(local.def.of.remote.queue) rname(apple.queue)
    rqmname('QMB') xmitq(QMA)
    The rname parameter specifies the name of the queue on the remote machine to which the message will be sent. Therefore, the name that the rname parameter specifies must be the name of the queue to which you want to send the message (that is, APPLE.QUEUE on the receiver workstation).
  6. On the receiver workstation, open a new command window and check which ports are free. Enter the following command:
    netstat -an
    This will show you a list of running processes. Check the port number of each of the processes to see if port 1414 is in use, this can be found by looking in the Local Address column. The information is given in the form ip_address:port_being _used.

    If port 1414 is not in use, use 1414 as the port number in step 7 and as the port for your listener later in the verification. If it is in use, select an alternative port that is not in use, for example 1415 if this is not being used by another process.

  7. On the sender workstation, in the MQSC command window, define a sender channel. Enter the following command:
    define channel(QMA.QMB) chltype(sdr) conname("con-name(port)")
    xmitq(QMA) trptype(tcp)
    Where:
    con-name
    is the TCP/IP address of the receiver workstation.
    port
    is the port on which the listener will be running on the receiver machine, the default value is 1414.
  8. In the MQSC command window, stop MQSC. Stop MQSC. Enter the following command:
    end
You have now defined the following objects:
  • A default queue manager called QMA
  • A transmission queue called QMA
  • A remote queue called LOCAL.DEF.OF.REMOTE.QUEUE
  • A sender channel called QMA.QMB