You can verify a server-to-server installation using two servers, one as a sender and one
as a receiver.
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
-
On the receiver server:
-
On Linux, log in as a user in the
mqm
group.
-
Check which ports are free, for example by running netstat. For more
information about this command, see the documentation of your operating system.
If port 1414 is not in use, make a note of 1414
to use as the port number in
step 2 h. 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.
-
Set up the environment for the installation you 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.
-
Create a queue manager called
QMB
by entering the following command at the
command prompt:
Messages tell you that the queue manager has been created, and that the default IBM MQ objects have been created.
-
Start the queue manager by entering the following command:
A message tells you when the queue manager has started.
-
Start MQSC by entering the following command:
A message tells you that MQSC has started. MQSC has no command prompt.
-
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.
-
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.
-
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.
-
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.
-
End MQSC by typing:
Some messages are displayed, followed by the command prompt.
-
On the sender server:
-
As the sender server is an AIX system, log in
as a user in the
mqm
group.
-
Set up the environment for the installation you 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.
-
Create a queue manager called
QMA
by entering the following command at the
command prompt:
Messages tell you that the queue manager has been created, and that the default IBM MQ objects have been created.
-
Start the queue manager, by entering the following command:
A message tells you when the queue manager has started.
-
Start MQSC by entering the following command:
A message tells you that an MQSC session has started. MQSC had no command prompt.
-
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.
-
Define a local definition of the remote queue with by entering the following command:
DEFINE QREMOTE (LOCAL.DEF.OF.REMOTE.QUEUE) RNAME (RECEIVER.Q) RQMNAME ('QMB') XMITQ (QMB)
-
Define a sender channel by entering one of the following commands:
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
b. If you do not specify a port, the default value of 1414 is used.
DEFINE CHANNEL (QMA.QMB) CHLTYPE (SDR) CONNAME ('CON-NAME(PORT)') XMITQ (QMB) TRPTYPE (TCP)
-
Start the sender channel by entering the following command:
The receiver channel on the receiver server starts automatically when the sender channel
starts.
-
Stop MQSC by entering the following command:
Some messages are displayed, followed by the command prompt.
-
Change into the
MQ_INSTALLATION_PATH/samp/bin
directory.
This directory contains the sample programs. MQ_INSTALLATION_PATH
represents the high-level directory in
which IBM MQ is installed.
-
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:
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.
-
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.
-
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.
-
On the receiver server:
-
As your receiver server is an AIX system,
change into the
MQ_INSTALLATION_PATH/samp/bin
directory.
This directory contains the sample programs. MQ_INSTALLATION_PATH represents the high-level directory in which
IBM MQ is installed.
-
Get the message from the queue on the receiver by entering the following command:
The sample program starts, and your message is displayed. After a pause, the sample
ends. Then the command prompt is displayed.
Results
You have now successfully verified the server-to-server installation.