Using the destination list to route messages (RouteToLabel and Label nodes)

You can determine the path that a message takes through the message flow using the RouteToLabel and Label nodes. These provide a more flexible way to process messages than the Filter node, which depends on the Boolean result of an ESQL expression for its logic.

When you use RouteToLabel and Label, you must include a Compute node that determines, using some combination of message content, database content, and ESQL logic, how messages are to be processed next. Configure the Compute node to create a destination list (within the DestinationList folder in the LocalEnvironment subtree) that contains the destination for each message, specified as the LabelName of a Label node. The Compute node passes the message to the RouteToLabel node, which reads the destination list and propagates the message to those destinations. You can configure the RouteToLabel node to work through the destinations from first to last, or last to first. There is no limit to the number of destinations that the Compute node writes in the destination list.

If you intend to derive destination values from the message itself, or from a database, you might also need to cast values from one type to another. For more information about the LocalEnvironment, see LocalEnvironment tree structure. For more information about casting, see Supported casts.

Look at the following samples to see how to use these nodes:

This use of the destination list is in contrast to its use to define the final recipients of the output messages; this is described in Creating destination lists.

The XML_PassengerQuery message flow in the Airline Reservations sample demonstrates how you can use the destination list in the LocalEnvironment to route messages based on the information in the message itself.

Related concepts
Message flows overview
LocalEnvironment tree structure
Related tasks
Using nodes for decision making
Testing the message structure (Check node)
Controlling the order of processing within a message flow
Testing the message content (Filter node)
Related reference
Label node
RouteToLabel node
ResetContentDescriptor node