SoftWoehr Class Library Examples

Revision 1.0.5

SoftWoehr Class Library and this documentation are Copyright *C* 1999, 2000
Jack J. Woehr, P. O. Box 51, Golden, Colorado 80402-0051 USA
http://www.softwoehr.com

Table of Contents

Introduction to examples

See the Build documentation for information on how to build the samples!

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

getmqmsg queue_manager_name queue_name
Retrieves and streams to standard output the first available message in queue queue_name managed by queue manager queue_manager.

mqinqtst

mqinqtst  queue_manager_name queue_name
Issues an inquiry on the queue queue_name associated with the queue manager queue_manager_name.

mqsettst

mqsettst queue_manager_name queue_name 0|1
If 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

mqtest queue_manager_name queue_name message
Opens the queue queue_name associated with the queue manager queue_manager_name puts the message message and retrieves it.

p1tmqmsg

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

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

qminqtst queue_manager_name
Issues a test inquiry on the queue manager named by queue_manager_name.

tstjxmq

This isn't actually an example, just code used by the other examples.