This program puts 10 messages to the queue, backing out the odd numbered messages and committing the even numbered messages. The message is a 4-byte number.
The queue used by this sample is the SYSTEM.DEFAULT.MODEL.QUEUE, so a temporary dynamic queue is created each time the program is run. You will need to run trace to see what happens when the program runs.
When compiling for a UNIX or OS/2 platform, ensure that the symbolic constant, WIN32 is not defined. This constant is used in the preprocessor statements for processing specific to Windows systems:
#if defined(WIN32)
When compiling, specify the following options (in addition to those usually specified for a WebSphere MQ application) to the C compiler:
-MD -DWIN32 -DDEC_DCE -Gz
The sample contains references to the Encina header files:
#include <tc/tc.h> #include <tmxa/tmxa_status.h> #include <tmxa/tmxa.h>
At compile time, also include the parent directory path name containing these files, using the compiler -I option with a value which names the directory. For example:
-Ic:\opt\encina\include
At link time, the directory path names containing the Encina and DCE library files must also be specified to the linker, by setting the LIB environment variable. For example:
SET LIB=C:\OPT\ENCINA\LIB;C:\OPT\DCE\LIB;%LIB%
When linking, specify the following library files:
Use the following invocation:
cc -I/opt/encina/include -c amqsxae0.c && cc -mt -o amqsxae0 amqsxae0.o \ -L/opt/encina/lib -L/opt/mqm/lib -lmqm -lmqmcs_d -lmqmzse -lmqmxa \ -lsocket -lnsl -ldce -lthread -lEncServer -lEncina -lc -lm