MQ Receive
The MQ Receive element is used to receive a MQ message from a queue. MQ Receive will read the message and the message will be removed from the queue. It is possible to setup a timeout value and a message selector.
Add MQ Receive to the Test Scenario by dragging it from the tool palette. This opens the Insert a new MQ Receive element popup. Here are the fields available when setting up this element:
- ID - this is the label name you want assigned.
- Description - an optional description of the Test Element.
Queue Manager - contains the information about where to receive the message.
This field supports variable substitution in the form of ${myid} and provides content assist. Type ${ and then press CTRL+SPACE to list the variables.
Queue - This contains the information about where to receive the message.
This field supports variable substitution in the form of ${myid} and provides content assist. Type ${ and then press CTRL+SPACE to list the variables.
Channel - This is the client channel to be used. At many installations this is SYSTEM.DEF.SVRCON.
This field supports variable substitution in the form of ${myid} and provides content assist. Type ${ and then press CTRL+SPACE to list the variables.
- Timeout after milliseconds - attribute specifies how many milliseconds to wait for a message before failing.
Message selector - This element contains an optional JMS message selector for selecting a specific message. It is possible to use variable substitution as part of the message selector to reference an Id from an MQ Send element. This field supports variable substitution in the form of ${myid} and provides content assist.
The graphical editor contains radio buttons for setting up a message selector using these options:
- None
- Message ID
- Correlation ID
After executing an MQ Receive, the content of the message, its ID, its Correlation Id and all properties are available to be referenced later in the test scenario. Available references:
- <id>.messageId
- <id>.correlationId
- <id>.propertie<propertyName>
- <id>.content
The <id>.content will contain the message content as plain text when there is no Structure name attribute. When there is a Structure name attribute, the content element will contain a data structure conforming to the Structure name, and fields can be referenced by variable substitution, expressions or a Data Reference.
- Structure name - optional attribute points to a Structure name located on the Functional Test element in the Structures tab. When using a Structure name, Total Test will parse the message and divide the content into fields. Messages containing numeric binary and packed data are also supported.
- OK / Cancel - click on OK to save your element.