The Set and Inquire message property sample
The message property sample programs demonstrate the addition of user-defined properties to a message handle, and the inquisition of the properties associated with that message.
- MQCONN
- MQOPEN
- MQPUT
- MQGET
- MQCLOSE
- MQDISC
- MQCRTMH
- MQDLTMH
- MQINQMP
- MQSETMP
The programs are delivered in the C language. The applications run in the batch environment. See Other samples for the batch applications.
The CSQ4BCM1 program is used to inquire the properties of a message handle from a message queue, and it is an example of the use of the MQINQMP API call. The sample gets one message from a queue and then prints all the message handle properties.
The CSQ4BCM2 program is used to set the properties of a message handle on a message queue, and it is an example of the use of the MQSETMP API call. The sample creates a message handle and puts it into the MsgHandle
field of the MQGMO structure. It then puts the message to a queue.
Other examples of inquiring and printing message properties are included in the CSQ4BCG1 and CSQ4BCP4 sample programs.
Running the CSQ4BCM1 sample
- The name of the target queue (required).
- The name of the queue manager (optional).
- Open options (optional).
- Close options (optional).
Running the CSQ4BCM2 sample
- The name of the target queue (required).
- The name of the queue manager (optional).
- Open options (optional).
- Close options (optional).
- The name of the target queue manager (optional).
- The name of the dynamic queue (optional).
The property names, values, and message content are provided through the standard input ( SYSIN DD ). There is a sample JCL to run the program, it resides in CSQ4BCMP.