+

Search Tips | Advanced Search

Converting bags and buffers

To send data between applications, firstly the message data is placed in a bag. Then, the data in the bag is converted into a PCF message using the mqBagToBuffer call. The PCF message is sent to the required queue using the MQPUT call. This is shown in Figure Figure 1. For a full description of the mqBagToBuffer call, see mqBagToBuffer.
Figure 1. Converting bags to PCF messages

To receive data, the message is received into a buffer using the MQGET call. The data in the buffer is then converted into a bag using the mqBufferToBag call, providing the buffer contains a valid PCF message. This is shown in Figure Figure 2. For a full description of the mqBufferToBag call, see mqBufferToBag.
Figure 2. Converting PCF messages to bag form