Message and Correlation IDs with IBM MQ

Document ID : KB000048426
Last Modified Date : 14/02/2018
Show Technical Document Details

The correlation and message IDs are controlled by setting LISA properties in the test case state. There are a number of filters that can be used to set LISA properties, including 'Store Step Response' and 'Save property from one key to another'.

The property names are:

  • lisa.mq.correlation.id - subscribe or publish using a string as the correlation ID
  • lisa.mq.correlation.id.bytes - subscribe or publish using a byte array as the correlation ID. The value of the LISA property must be set to a byte array.
  • lisa.mq.message.id - subscribe or publish using a string as the message ID
  • lisa.mq.message.id.bytes - subscribe or publish using a byte array as the message ID. The value of the LISA property must be set to a byte array.

The same properties are used for both publishing and subscribing. If any of those properties are set when an MQ publish step is executed then the published MQ message's correlation ID and message ID will be set accordingly. If any of those properties are set when an MQ subscribe step is run then the subscriber will only receive messages that match the correlation or message ID.

Note: This does not work with an Async MQ subscriber until LISA version 4.7 or later.