The behavior of the Route subflow depends on the value of the Routing pattern parameter.
If No Routing is selected, a single MQOutput node is created and configured with the values of the Output queue manager and Output queue pattern parameters. The routing flow is a subflow that includes a Passthrough node. The Failure node is included so that this subflow is consistent with all other types of routing subflow.
A group of four parameters that define a route:
For each route that is defined, an Output terminal for the Route subflow and an MQOutput node are created and connected.
The Route subflow contains a Route node that is configured with a filter that routes to the Output terminal if the condition KeyLocation = Key Value is fulfilled. If a message element does not match any of the routes, the error is noted in an environment variable and the message is passed to the Failure terminal.
A number of routes can be specified by using Specify Routes.
If this value is selected, a single Output terminal is created for the Route subflow and this terminal is connected to a single MQOutput node that is configured to take a destination list.
The routing subflow checks if the cache requires refreshing by checking whether the value of the CacheQueueTable.valid shared row variable is set to NULL. It is set to NULL when the flow starts and also if Cache refresh is enabled and a refresh message has been sent to Refresh queue. Refresh messages set the value to NULL.
If the cache requires refreshing, the ROUTING_TABLE table of the data source, specified in the Routing data source pattern parameter, is searched to find all of the rows that match the routing context for this flow. The routing context is defined by the Routing context pattern parameter, and rows where the ROUTING_CONTEXT field matches this parameter are read into an in-memory cache, which is done automatically to prevent lookups while the cache is in an inconsistent state.
The structure of the cached data is:
VARIABLE1, VARIABLE2, QUEUE_MANAGER, QUEUE_NAME
The lookup is performed by extracting one, or two, key values from the message element, by using ESQL expressions that are defined as pattern parameters. Define pattern parameters by using a statement in the following form:
SET KEY = <pattern parameter>
If a single key is specified to select a row, or rows, from the routing data, use a WHERE clause:
WHERE S.VARIABLE1 = KEY1
If a second key is specified, the WHERE clause used for selection is:
WHERE S.VARIABLE1 = KEY1 and S.VARIABLE2 = KEY2
This selection sets the queue manager and queue into the local environment that is used in the MQOutput node. Multiple rows can be returned, and the destination data includes all selected destinations. If no match is found, a routing error occurs and the message is passed to the Failure terminal of the Route subflow.