Correlation ID (-CID)

Use the Correlation ID adapter command (-CID) to specify a particular correlation identifier (CID) for a source or target. Use this adapter command for a data source to retrieve messages from a queue with a specific correlation ID. You can also use it for a data target to assign a correlation ID to a message when placing it on a queue. A correlation identifier can be up to 24 bytes long and is expected to contain printable characters.

-CID [correlation_ID]

Spaces can also be specified in values. However, if the value contains a space, it must be enclosed with double quotation marks as shown in the example below:

-CID "my ID"

The double quotation mark character can also be used as part of a value. To do this, the double quotation mark value must be represented by a pair of double quotation marks. For example, if you wanted to specify a correlation ID of My "New" ID, you would need to enter the following:

-CID "My ""New"" ID"

When a correlation identifier is specified for a source, the adapter retrieves the first message on the queue with that correlation ID. If no argument is supplied, the correlation ID of the first message retrieved is used.

If the Correlation ID adapter command (-CID) is specified and is used with the Message ID adapter command (-MID), the retrieved messages begin with the first message on the queue that has the specified message ID and the correlation ID. Additional messages are retrieved that have the same message ID and correlation ID. If no correlation ID is specified, the message is identified only by the message ID.

When a correlation identifier is specified for a data target, the adapter places the message on the queue with the assigned correlation identifier.