Putting messages on a queue

 

Use the MQPUT call to put messages on the queue. We can use MQPUT repeatedly to put many messages on the same queue, following the initial MQOPEN call. Call MQCLOSE when you have finished putting all your messages on the queue.

If you want to put a single message on a queue and close the queue immediately afterwards, we can use the MQPUT1 call. MQPUT1 performs the same functions as the following sequence of calls:

Generally however, if you have more than one message to put on the queue, it is more efficient to use the MQPUT call. This depends on the size of the message and the platform that you are working on.

This chapter introduces putting messages to a queue, under these headings:

 

Parent topic:

Writing a WebSphere MQ application


fg12310_