MQ Send – Source Reference
The MQ Send <MQSend> element is used to send a MQ message to a queue. It is possible to reference a MDataDefinition defined in the Total Test Scenario. This is useful when the message must contain data representing a record structure.
Syntax
The syntax of the MQSend element is:
channel="<channel>"
queueManager="<queueManagetr>" queue="<queue>"
replyToQueue="<replyQueue>" id="<id>"
description="<description>"
mDataDefinition="<mDataDefinition>">
<Message>
text or datastructure
</Message>
</MQSend>
Priority and expiration are set in milliseconds. If they are not specified or the values are -1, default values from the MQClient will be used. Channel is the client channel to be used. At many installations this is SYSTEM.DEF.SVRCON.
Queue manager and queue contain the information about where to put the message. ReplyToQueue is optional.
After the execution of MQSend, it is possible to reference the messageId of the sent message. This can, for example, be done by variable substitution with ${<idOfMQSend>.messageId}.
Example
Below will send a message that will contain a string with a record structure of three fields. Below the MQ Send element the MDataDefinition from the Total Test Scenario metadata section is shown where it can be seen how the data types of each field has been defined. The message length to be sent will be 90 bytes and will automatically be converted to EBCDIC.
queueManager="CSQ7" queue="XATESTER.REQUEST.QUEUE" replyToQueue="XATESTER.REPLY.QUEUE"
id="sender"
label="Send message" description="send binary data" mDataDefinition="sender">
<Message>
<MqInUserid>steen</MqInUserid>
<MqInReqID>123456</MqInReqID>
<MqInReqMsg>Hello World</MqInReqMsg>
</Message>
</MQSend>
..
<MDataDefinition name="sender">
<MqInUserid type="Character" length="8" bytes="8" />
<MqInReqID type="Character" length="16" bytes="16" />
<MqInReqMsg type="Character" length="66" bytes="66" />
</MDataDefinition>