The MQ Input node will typically read messages from its specified input queue in the manner of FIFO (First In First Out), but there are some situations where an architecture requires specific messages to be read from a queue. In these situations, the properties on the MQ Input node's Advanced tab of Match message ID
or Match correlation ID
can be helpful. As their name suggests, these fields can be given a hexadecimal number which is used to execute a selective read of messages from the queue whose identifier (carried in the MQMD header of the message) matches the static value. This existing capability of the product has been further enhanced in App Connect Enterprise 12.0.5.0 to allow the specification of the message ID / correlation ID via a user variable which can be passed to the message flow when the integration server process is started.
This practice will prove particularly helpful when deploying multiple container replicas within a Cloud Pak for Integration environment. When running containers, you may wish to independently scale MQ and ACE by using a single queue manager to service multiple Integration Server replicas, each of which makes an MQ client connection and reads from the same queue. In these situations, you might also require a given ACE integration server replica to be able to retrieve its own particular reply messages from the queue. For example, consider a flow whose purpose is to receive HTTP requests, transform and route them to MQ, and then receive responses from an MQ back-end application before sending a transformed response message back to the initiating HTTP client. In order for the reply message to be successfully returned to the waiting HTTP client, it is essential that integration server replicas should only ever take their own reply messages from the queue and nobody elses.
You can assign the name of a user variable to the Match correlation ID
property as shown below. Note that in the ACE 12.0.5.0 Toolkit, the validation of the field in the UI has not yet caught up with this new feature and still expects a hexadecimal number. You can safely ignore this error and using a variable will not block you from saving the message flow and continuing to build a BAR file and deploy the message flow.
The syntax used when defining the property expects the hard-coded prefix value of iib.user-
inside square brackets. The characters after this prefix are expected to match a user variable, which has been defined in the server.conf.yaml file, like the example below:
UserVariables:
encodedvar: '0x111111111122222222223333333333444444444412345678'
In order to satisfy the architectural need discussed above, where different replicas of the same integration server use different values for the matching correlation ID, it is necessary to combine this new feature with the ability to specify a start-up script for an integration server. Consider the example server.conf.yaml shown below which demonstrates how the hostname of a container replica can easily be converted into a unique hex value using the sha1sum
command. The sha1sum
command is available in Linux environments and can be used to compute a SHA-1 message digest (a 20 byte hash value). In this example, the value of the User Variable (named encodedvar
) is applied directly from the output of the startup script
StartupScripts:
EncodedHostScript:
command: 'export ENCODED_VAR=`echo $HOSTNAME | sha1sum | tr -d "-" | tr -d " "` && echo UserVariables: && /bin/echo -e " encodedvar: \\x27$ENCODED_VAR\\x27"'
readVariablesFromOutput: true