WebSphere WebSphere Enterprise Service Bus, Version 6.0 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Message Filter mediation primitive

Use the Message Filter mediation primitive to selectively route messages.

Introduction

The Message Filter mediation primitive uses expressions, so you can direct messages that meet certain criteria down different paths of a flow.

The Message Filter mediation primitive has one input terminal and multiple output terminals. The input terminal is wired to accept a message and the output terminals are wired to propagate a message. One output terminal is for failure output and one is the default output terminal. The other output terminals are each associated with a simple, conditional expression. The contents of the message are compared with each expression in turn, and if the condition is met then the message is propagated to the associated output terminal. The primitive can be configured either to use the first matching output terminal, or all matching output terminals. The default output terminal is used if the message meets none of the conditions.

If an exception occurs during the filtering then the fail terminal propagates the original message, together with any exception information.

Usage

You can use the Message Filter mediation primitive to check that the inbound message meets some criterion. For example, that a required field is set. If the criterion is not met you can raise a fault using the Fail mediation primitive, or send an error response.

The Message Filter mediation primitive lets different messages take different paths. For example, a message might need forwarding to different service providers based on the request details.

You can use the Message Filter mediation primitive to bypass unnecessary steps. You can test if certain data is in a message, and only perform a Database Lookup operation if the data is missing.

When used in combination with a Database Lookup primitive, the Message Filter can direct messages based on an independently administrable lookup table. For example, you could route a message based on customer status even if the inbound message contained only the customer identifier.

By configuring the primitive to propagate messages to all matching terminals, you can trigger multiple events each requiring different conditions. For example, you could log requests relating to a particular account identifier and send requests relating to a particular product to be audited.

Properties

Filters
A list of expressions, and associated terminal names, that define the filtering performed by the mediation primitive.
Note: Order is significant in the list of expressions. Expressions are evaluated in the order they appear in the table.
Pattern
An XPath 1.0 expression against which the message will be tested. The expression is evaluated, starting from the XPath expression specified by Root.
Terminal name
The name of an output terminal. There is one terminal name for each pattern XPath expression. The terminal name must be a valid connection endpoint, and it must not be fail or default. The default value is empty, which is invalid.
Root
An XPath 1.0 expression representing the root from which patterns are evaluated. You can specify: /, /body, /headers, or your own XPath expression. / refers to the complete SMO, /body refers to the body section of the SMO, /headers refers to the headers of the SMO. If you specify your own XPath expression then the part of the SMO you specify is processed.
Distribution mode
Determines the behavior of the mediation primitive when an inbound message matches multiple expressions. If Distribution mode is set to First then the message is propagated to the first matching output terminal. If Distribution mode is set to All then the message is propagated to all matching output terminals. If there is no matching output terminal then the default terminal is invoked.
Table 1. Message Filter mediation primitive properties
Property Valid Values Default
Filters Pattern String: An XPath expression against which the input message will be tested  
Terminal name String  
Root String: An XPath expression representing the root of the transformation /body
Distribution mode String: All or First First

Considerations

Consider the following when using the Message Filter mediation primitive:


Reference topic

Terms of Use |

Last updated: 20 Nov 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.wbit.help.medprim.doc\ref\rwesb_MessageFiltermediationprimitive.html

© Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)