Log out?

Content Based Routing

eiConsole v.13.17R2
Tutorial & Interface

eiConsole Tutorial Basic

Content Based Routing 


This interface demonstrates how to accomplish content-based routing; that is, it is a demonstration of how to conditionally send data to an endpoint based on the data itself.

Content based routing may be used when:

  • Data needs to flow conditionally to one or more target systems.
  • Data should proceed conditionally.
  • Data should process differently according to its contents; for example, when different data versions or data Formats originate from the same source.

How to Run This Example

You may run from the Listener by configuring the attached environmental properties file, or from the eiConsole testing mode at any point in the process prior to the routing module itself, using the attached documents Sample2.xml and Sample3.xml.

Sample2.xml will be routed to one Transport, and Sample3.xml will be routed to the other. The system utilizes the id to identify which transport to route to; Sample3.xml uses the Id=”3″ namespace, for example.

How it Works

  • The routing module is configured in the routing stage
  • Viewing the routing stage in the eiConsole, you will notice two rules.
  • Each performs an XPath operation; if the XPath operation evaluates to a Node (if the given XPath target can be found in the data), that rule evaluates to true.
  • If a rule evaluates to true, the configured transport is added to the list of valid Targets for the current transaction.

Note: that if “Accumulate Targets”, found in the root configuration of the routing module, is checked, it will send to all Transports in its list. If it is unchecked, only the first transport it identifies will be utilized.

How to Use This Example

Click the links below for the files you will need for this tutorial, then DOWNLOAD INTERFACE to get started. (Once logged into the eiConsole it immediately shows up in your “PIE” inbox for use.)

icon_sample-dataSample Data
icon_sample-dataSample Data
icon_file-configConfiguration File
icon_downloadInterface Download

Note: if you are not logged in to the eiConsole, or have arrived at this page via a browser, you will be prompted to login before the interface downloads into your eiConsole “PIE” inbox. Or if you have not downloaded and installed a FREE eiConsole Trial you will have the opportunity to register after you click the Interface Download link. Once you are logged in the interface will automatically download into your “PIE” inbox. First, you’ll see a screen pop up indicating that a new product is ready for download. Select the Download Now button. Once you’ve downloaded the Interface you can drag it into your current Working Directory and begin.

Next, follow the tutorial and walk through it step-by-step. You may check your work against the provided Route (Sample Data).

Open the Main Route Grid for the Sample Interface

This interface has four functioning pieces: the listener, the router, and the two transports. It performs no data transformation.

Listener Configuration


The listener polls a directory set by a configuration value stored in the environment properties file (included with this interface) every five seconds. The sample files intended to be used with this interface are provided alongside this instructional guide; they are Sample2.xml and Sample3.xml.

Routing Configuration

The routing configuration is very simple; it uses two XPath-based rules, each performing a different operation. One Routes all Transactions with an Id of 3 to a particular transport; the other routes all transactions with an Id of 2 to a different transport. This is the fundamental mechanism by which all routing is performed; a rule is defined, criteria are defined for that rule, and an operation is optionally defined. Rules can be nested. There are two different modes for routing; Accumulate Matched Targets, and Single Target. Accumulate Targets will continue evaluating rules and executing operations; Single Target will stop at the first operation successfully performed.

Below is one of our sample transactions (contained in the Sample3.xml):

  1. <?xml version=“1.0” encoding=“UTF-8”?>
  2. <ns2:Attachment xmlns:ns2=“Sample3.Namespace” Id=“3”>
  3.         <ns2:CreatedDate>2012-07-18</ns2:CreatedDate>
  4.         <ns2:LastModifiedDate/>
  5.         <ns2:LifeCycleId/>
  6.         <ns2:Mime>Text/XML</ns2:Mime>
  7.         <ns2:AttachmentData>VEhJUyBJUyBXSUsgV0lLIEEgU0FNUExFIFRFWFQgQVRUQUNITUVOVA==</ns2:AttachmentData>
  8.         <ns2:AttachmentReason>Order</ns2:AttachmentReason>
  9. </ns2:Attachment>

Note: the Id in this case is 3, so it would be routed to the ID3 transport. This can be experimentally verified by running this transaction through in test mode:

Run the Transaction Through the Testing Mode

Copy the Sample3.xml into the Polling directory.

Transport Configuration


Both of the transports are configured similarly, only the file name is different.


Here we also use an environment property: $$Pilotfish.Demonstration.Directory.Out=C:\Test\Directory\Out

This concludes this tutorial of a content-based routing.

This is a unique website which will require a more modern browser to work! Please upgrade today!


Our editors are notified.