Overriding MQReply node properties during message processing
When you include and configure an MQReply node in a message flow, you might want to override its properties under some conditions. For example, you might want to connect to a different queue manager based on data in another part of the message, or that is retrieved from a database record.
About this task
To override the values that you set for the MQReply node properties to achieve a more dynamic way to process messages, include a Compute or JavaCompute node in your message flow before the MQReply node. Configure this node to create an output message, and add fields to the local environment tree to define new values for the properties that you want to change.
- <parent folder>.policyUrl to override the whole policy for the node.
- <parent folder>.<MQEndpoint policy attribute> to provide (or override) a specific value.
Examples of the MQEndpoint policy attributes include destinationQueueManagerName and channelName. A special value of ‘-‘ can be used in the policyUrl property to mean “use the node attributes”, which is useful if only one value in the policy needs to be overridden.
Procedure
OutputLocalEnvironment.Destination.MQ.
as the correlation name for all
fields that relate to the MQReply node.
You can set any MQEndpoint policy attribute under the OutputLocalEnvironment.Destination.MQ tree, including the following examples:
Setting | Description |
---|---|
policyUrl | This setting ignores the MQReply node
policy, and uses ValidMQClientPolicy in the TestPolicies
project: This
setting overrides any previous setting on the node regardless of whether a policy is configured for
the node. Using this setting also causes a search for policies in the run directory when a
previously deployed policy cannot be found. This allows policies to be used even if they were not
visible when the server started, enabling configuration to be changed by copying policy files into
place or by using a volume mount in a container to provide dynamic configuration updates. |
connection | This setting overrides the MQReply node
connection property; for
example:
|
destinationQueueManagerName | This setting overrides the MQReply node
destinationQueueManagerName property; for
example:
|
queueManagerHostname | This setting overrides the MQReply node
queueManagerHostname property; for
example:
|
listenerPortNumber | This setting overrides the MQReply node
listenerPortNumber property; for
example:
|
channelName | This setting overrides the MQReply node
channelName property; for
example:
|
SET OutputLocalEnvironment.Destination.MQ.policyUrl = '{TestPolicies}:ValidMQClientPolicy';
SET OutputLocalEnvironment.Destination.MQ.policy.destinationQueueManagerName = 'Other_QM';
Specifying a policyUrl of "-" causes the node attributes (either explicit configuration or policy) to be used as the attributes for the merge. This value enables a subset of node settings to be overridden without needing to know the policy for the node. For example, the following combination of settings would change only the channelName setting and use all of the other settings from the node configuration.
SET OutputLocalEnvironment.Destination.MQ.policyUrl = '-';
SET OutputLocalEnvironment.Destination.MQ.policy.channelName = 'SYSTEM.BKR.CONFIG';