Client Verification

 

When an MQ application is run on the WebSphere MQ client, it requires the name of the MQI channel, the communication type, and the address of the server to be used. You provide this by defining a client-connection channel. The name used must be same as the name used for the server-connection channel defined on the server.

Before starting, ping hostname to confirm the server is reachable.

Create a client-connection channel by setting the MQSERVER environment variable.

export MQSERVER=CHANNEL1/TCP/'server-address(port)'

...or...

export MQSERVER=CHANNEL1/TCP/server-address\(port\)

If you do not give a port number, WebSphere MQ uses the one specified in the QM.INI file. If no value is specified in the QM.INI file, the port number identified in the TCP/IP services file for the service name MQSeries. If this entry in the services file does not exist, a default value of 1414 is used.

 

amqsputc

You can use the amqsputc client program to put a message on the queue.

PATH=$PATH:/opt/mqm/samp/bin:/opt/mqm/bin
amqsputc queue_name queue_mgr_name

The following message is should be displayed:

Sample AMQSPUT0 start
target qname is queue_name

Type a sample message text and then press Enter twice. The following message is displayed...

Sample AMQSPUT0 end

...which means the message is now on the queue.

Note that amqsputc starts and stops the channel between the client and the server.

To get a message from the queue use amqsgetc:

PATH=$PATH:/opt/mqm/samp/bin:/opt/mqm/bin
amqsgetc QUEUE1 qmgr

To stop the queue manager...

endmqm qmgr1 /blockquote>

To delete the queue manager type:

dltmqm qmgr1