WebSphere MQ sample code examples (java,c,c++)
Testing communication between workstations
Before you complete this task you must have completed, Setting up the client workstation.
On the WebSphereŽ MQ client workstation, use the amqsputc sample program to put a message on the queue at the server workstation, and the amqsgetc sample program to get the message from the queue back to the client:
Change into the /opt/mqm/samp/bin directory,
which contains the sample programs.
Put a message on the queue at the server using the following command:
./amqsputc QUEUENAME QMANAGER
This displays the following messages:
Sample amqsput0 start
target queue is QUEUENAME
Type some message text on one or more lines, followed by a blank line.
You will see the following message:
Sample amqsput0 end
Your message is now on the queue and the command prompt is displayed again.
To get the message from the queue located on the server, enter the following command:
./amqsgetc QUEUENAME QMANAGER
The sample program starts and your message is displayed.
After a pause, the sample ends and the command prompt is displayed again.