Verifying with the sample application
An installation verification program, MQIVP, is supplied with WebSphere MQ base Java.
You can use this program to test all the connection modes
of WebSphere MQ base Java. The program prompts for a number of choices and other data to
determine which connection mode you want to verify. Use the following procedure
to verify your installation:
- If you are going to run the program in client mode, configure
your queue manager as described in Configuring your queue manager to accept client connections.
- The user ID associated with the program when it runs must have
authority to access certain resources of the queue manager. Grant the following
authorities to the user ID:
- The authority to connect to the queue manager, and the authority to inquire
on the attributes of the queue manager object
- The authority to put messages on the queue SYSTEM.DEFAULT.LOCAL.QUEUE,
and the authority to get messages from the queue
For information about how to grant authorities, see the following books:
- WebSphere MQ for iSeries V6 System Administration Guide, if the queue manager is running on i5/OS
- WebSphere MQ System Administration Guide, if the queue manager is running on a UNIX system
or Windows
- WebSphere MQ for z/OS System Setup Guide, if the queue manager is running on z/OS
If you are going to run the program in client mode, see also WebSphere MQ Clients.
Perform the remaining steps of this procedure on the system on which you are
going to run the program.
- Make sure that you have updated your CLASSPATH environment variable
according to the instructions in Environment variables.
- At a command prompt, enter:
java -Djava.library.path=library_path MQIVP
where library_path is the path to the WebSphere MQ Java libraries (see The WebSphere MQ Java libraries).
The program tries to:
- Connect to the queue manager
- Open the queue SYSTEM.DEFAULT.LOCAL.QUEUE, put a message on the
queue, get a message from the queue, and then close the queue
- Disconnect from the queue manager
- Return a message if the operations are successful
- At the prompt marked (§):
- To use a TCP/IP connection, enter a WebSphere(R) MQ server host name.
- To use native connection (bindings mode), leave the field blank. (Do not
enter a name.)
Here is an example of the prompts and responses you might see. The actual
prompts and your responses depend on your WebSphere MQ network.
Please enter the IP address of the MQ server : ipaddress(§)
Please enter the port to connect to : (1414)(§§)
Please enter the server connection channel name : channelname(§§)
Please enter the queue manager name : qmname
Success: Connected to queue manager.
Success: Opened SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Put a message to SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Got a message from SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Closed SYSTEM.DEFAULT.LOCAL.QUEUE
Success: Disconnected from queue manager
Tests complete -
SUCCESS: This MQ Transport is functioning correctly.
Press Enter to continue ...
Notes:
- On z/OS, leave the field blank at prompt marked (§).
- If you choose server connection, you do not see the prompts marked (§§).
- On i5/OS, you can issue the command java MQIVP only from QShell. Alternatively, you can run the application
by using the CL command RUNJVA CLASS(MQIVP).