On the IBM® WebSphere® MQ MQI client workstation, use the amqsputc sample program to put a message on the queue at the server workstation.
Use the amqsgetc sample program to get the message
from the queue back to the client.
Before you begin
Complete the previous topics in this section:
- Set up a queue manager, channels, and queue.
- Open a command window.
- Set system environment variables.
About this task
Note that IBM WebSphere MQ object definitions are case-sensitive. 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 UNIX and Linux® systems, change into the
MQ_INSTALLATION_PATH
/samp/bin
directory
, which contains the sample programs. For IBM WebSphere MQ client for HP Integrity NonStop Server, change into the MQ_INSTALLATION_PATH/opt/mqm/samp/bin directory, which contains the sample
programs. MQ_INSTALLATION_PATH
represents the high-level directory in which IBM WebSphere MQ is installed.
- If you are verifying an installation on a UNIX, Linux, or Windows system, you
must set certain environment variables so that the installation can
be used in the current shell. This step is not
applicable to IBM WebSphere MQ client for HP Integrity NonStop Server. You can set the environment variables by entering one
of the following commands:
- Start the PUT program for
QUEUE1
on QUEUE.MANAGER.1
by entering one of the following commands:
If the command is successful, the following messages are
displayed:
Sample AMQSPUT0 start target queue is QUEUE1
Tip: You might get the error,
MQRC_NOT_AUTHORIZED (
2035). By default, channel authentication is enabled
when a queue manager is created. Channel authentication prevents privileged
users accessing a queue manager as a
IBM WebSphere MQ MQI client. For verifying
the installation, you can either change the MCA user ID to a non-privileged
user, or disable channel authentication. To disable channel authentication
run the following MQSC command:
ALTER QMGR CHLAUTH(DISABLED)
When you finish the test, if you do not delete the queue manager,
re-enable channel authentication:
ALTER QMGR CHLAUTH(ENABLED)
- Type some message text, then press Enter twice.
The following message is displayed:
Sample AMQSPUT0 end
Your message is now on the queue
that is on the server queue manager.
- Start the GET program for
QUEUE1
on QUEUE.MANAGER.1
by entering one of the following commands:
The sample program starts, and your message is displayed.
After a short pause (approximately 30 seconds), the sample ends and
the command prompt is displayed again.
Results
You have now successfully verified the client installation.
What to do next
- If your server is a Windows, UNIX, or Linux system, you
must set various environment variables so that the installation can
be used in the current shell. You can set the environment variables
by entering one of the following commands:
- On the server, stop the queue manager by entering the following
command:
endmqm QUEUE.MANAGER.1
- On the server, delete the queue manager by entering the following
command:
dltmqm QUEUE.MANAGER.1