+

Search Tips | Advanced Search

Verify a server-to-server installation using the command line on Windows

We can verify a server-to-server installation using two servers, one as a sender and one as a receiver.


Before starting

  • On Windows, IBM MQ supports TCP, SNA, NetBios, and SPX.

    The examples in this task use TCP/IP. If we do not use TCP, see Set up communication for Windows.

  • Make sure that we are a member of the IBM MQ administrators group (mqm) on each server.
  • Decide which installation is the sender server and which installation is the receiver server. The installations might be on the same system, or on different systems.


About this task

IBM MQ object definitions are case-sensitive. Any text entered as an MQSC command in lowercase is converted automatically to uppercase unless you enclose it in single quotation marks. Make sure that you type the examples exactly as shown.


Procedure

  1. On the receiver server:
    1. Check which ports are free, for example by running netstat. For more information about this command, see the documentation of our operating system.

      If port 1414 is not in use, make a note of 1414 to use as the port number in step 2 g. Use the same number for the port for your listener later in the verification. If it is in use, note a port that is not in use; for example 1415.

    2. Set up the environment for the installation we are using by entering the following command at the command prompt:
       MQ_INSTALLATION_PATH\bin\setmqenv -s
      
      where MQ_INSTALLATION_PATH refers to the location where IBM MQ is installed.
    3. Create a queue manager called QMB by entering the following command at the command prompt:
      crtmqm QMB
      
      Messages tell you that the queue manager has been created, and that the default IBM MQ objects have been created.
    4. Start the queue manager by entering the following command:
      strmqm QMB
      
      A message tells you when the queue manager has started.
    5. Start MQSC by entering the following command:
      runmqsc QMB
      
      A message tells you that MQSC has started. MQSC has no command prompt.
    6. Define a local queue called RECEIVER.Q by entering the following command:
      DEFINE QLOCAL (RECEIVER.Q)
      
      A message tells you the queue has been created.
    7. Define a listener by entering the following command:
      DEFINE LISTENER (LISTENER1) TRPTYPE (TCP) CONTROL (QMGR) PORT ( PORT_NUMBER )
      
      Where port_number is the name of the port the listener runs on. This number must be the same as the number used when defining your sender channel.
    8. Start the listener by entering the following command:
      START LISTENER (LISTENER1)
      
      Note: Do not start the listener in the background from any shell that automatically lowers the priority of background processes.
    9. Define a receiver channel by entering the following command:
      DEFINE CHANNEL (QMA.QMB) CHLTYPE (RCVR) TRPTYPE (TCP)
      
      A message tells you when the channel has been created.
    10. End MQSC by typing:
      end
      
      Some messages are displayed, followed by the command prompt.

  2. On the sender server:
    1. Set up the environment for the installation we are using by entering the following command at the command prompt:
       MQ_INSTALLATION_PATH\bin\setmqenv -s
      
      where MQ_INSTALLATION_PATH refers to the location where IBM MQ is installed.
    2. Create a queue manager called QMA by entering the following command at the command prompt:
      crtmqm QMA
      
      Messages tell you that the queue manager has been created, and that the default IBM MQ objects have been created.
    3. Start the queue manager, by entering the following command:
       strmqm QMA
      
      A message tells you when the queue manager has started.
    4. Start MQSC by entering the following command:
       runmqsc QMA
      
      A message tells you that an MQSC session has started. MQSC had no command prompt.
    5. Define a local queue called QMB (to be used as a transmission queue) by entering the following command:
      DEFINE QLOCAL (QMB) USAGE (XMITQ)
      
      A message tells you when the queue has been created.
    6. Define a local definition of the remote queue by entering the following command:
      DEFINE QREMOTE (LOCAL.DEF.OF.REMOTE.QUEUE) RNAME (RECEIVER.Q) RQMNAME ('QMB') XMITQ (QMB)
    7. Define a sender channel by entering the following command:
      DEFINE CHANNEL (QMA.QMB) CHLTYPE (SDR) CONNAME ('CON-NAME(PORT)') XMITQ (QMB) TRPTYPE (TCP)
      

      con-name is the TCP/IP address of the receiver system. If both installations are on the same system, the con-name is localhost. port is the port you noted in 1 a. If we do not specify a port, the default value of 1414 is used.

    8. Start the sender channel by entering the following command:
      START CHANNEL(QMA.QMB)
      
      The receiver channel on the receiver server starts automatically when the sender channel starts.
    9. Stop MQSC by entering the following command:
      end
      
      Some messages are displayed, followed by the command prompt.
    10. If both the sender server and receiver server are installations on the same system, check that the queue managers have been created on different installations by entering the following command:
      dspmq -o installation
      
      If the queue managers are on the same installation, move either QMA to the sender installation or QMB to the receiver installation by using the setmqm command. For more information, see setmqm.
    11. Put a message on the local definition of the remote queue, which in turn specifies the name of the remote queue. Enter the following command:
      amqsput LOCAL.DEF.OF.REMOTE.QUEUE QMA
      
      A message tells you that amqsput has started.
    12. Type some message text on one or more lines, followed by a blank line. A message tells you that amqsput has ended. Your message is now on the queue and the command prompt is displayed again.

  3. On the receiver server:
    1. Get the message from the queue on the receiver by entering the following command:
      amqsget RECEIVER.Q QMB
      
      The sample program starts, and your message is displayed. After a pause, the sample ends. Then the command prompt is displayed.


Results

We have now successfully verified the server-to-server installation. Parent topic: Verify an IBM MQ installation on Windows

Last updated: 2020-10-04