The example programs in essence say quite a bit about the approach taken in the class library. That is, they are extremely simple. Messages are assumed to be composed entirely of printable characters.
Note that there is nothing in the class library itself that limits messages to printable characters, or to any format whatsoever. To the class library, a message is an array of unsigned char.
In any event, these simple examples put and get printable messages from the queue and do some inquiries on the queue and queue manager. They do not illustrate all possibilities but they tour the domain.
All examples either perform their task verbosely or stream diagnostics to standard error in the event of failure.
getmqmsg queue_manager_name queue_nameRetrieves and streams to standard output the first available message in queue queue_name managed by queue manager queue_manager.
mqinqtst queue_manager_name queue_nameIssues an inquiry on the queue queue_name associated with the queue manager queue_manager_name.
mqsettst queue_manager_name queue_name 0|1If the third argument is 1, mqsettst sets message inhibit, that is, messages can no longer be retrieved from queue queue_name associated with queue manager queue_manager_name. If the command is then subsequently issued with a third argument of 0 then mesage retrieval is again possible.
mqtest queue_manager_name queue_name messageOpens the queue queue_name associated with the queue manager queue_manager_name puts the message message and retrieves it.
p1tmqmsg queue_manager_name queue_name "message string"Takes the third argument to be a printable string which is then put to queue queue_name on queue manager queue_manager_name. The difference between this and the putmqmsg command is that p1tmqmsg uses the MQSeries API PUT1 that does not require an open queue manager.
putmqmsg queue_manager_name queue_name "message string"Takes the third argument to be a printable string which is then put to queue queue_name on queue manager queue_manager_name.
qminqtst queue_manager_nameIssues a test inquiry on the queue manager named by queue_manager_name.