Contact Us 1-800-596-4880

Filters Configuration Reference

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

For more information, see Filters.

Filter

A filter that is defined elsewhere (at the global level, or as a Spring bean).

Attributes of filter

Name Description

ref

The name of the filter to use.
Type: string
Required: yes
Default: none

No child elements for filter.

Not Filter

Inverts the enclosed filter. For example, if the filter would normally return true for a specific message, it now returns false, and vice versa.

Attributes of not-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

Child Elements of not-filter

Name Cardinality Description

abstract-filter

0..1

A placeholder for filter elements, which control which messages are handled.

And Filter

Returns true only if all the enclosed filters return true.

Attributes of and-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

Child Elements of and-filter

Name Cardinality Description

abstract-filter

2..*

A placeholder for filter elements, which control which messages are handled.

Or Filter

Returns true if any of the enclosed filters returns true.

Attributes of or-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

Child Elements of or-filter

Name Cardinality Description

abstract-filter

2..*

A placeholder for filter elements, which control which messages are handled.

Wildcard Filter

A filter that matches string messages against wildcards. It performs matches with "*", for example, "jms.events.*" would catch "jms.events.customer" and "jms.events.receipts". This filter accepts a comma-separated list of patterns, so more than one filter pattern can be matched for a given argument: "jms.events.*, jms.actions.*" matches "jms.events.system" and "jms.actions" but not "jms.queue".

Attributes of wildcard-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

pattern

The property name and optionally a value to use when matching. If the expression is just a property name, the filter checks that the property exists. Users can also use '=' and '!=' to determine a specific value for a property.
Type: string
Required: yes
Default: none

caseSensitive

If false, the comparison ignores case.
Type: boolean
Required: no
Default: true

No child elements for wildcard-filter.

Expression Filter

A filter that can evaluate a range of expressions. It supports some base expression types such as header, payload (payload type), regex, and wildcard.

Attributes of expression-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

evaluator

The expression evaluator to use. The expression filter supports some types such as header, payload, exception, wildcard, and regex, that are built-in filters not registered with the ExpressionEvaluatorManager. All others are registered with the ExpressionEvaluatorManager. Where XPath, bean, and ONGL are used, the expression should be a boolean expression.
Type: expressionFilterEvaluators
Required: no
Default: none

expression

The expression to evaluate. This should always be a boolean expression. The syntax of the expression determines the expression language being used.
Type: string
Required: yes
Default: none

customEvaluator

Must be set if the evaluator is set to custom. The custom evaluator must be registered with the ExpressionEvaluatorManager if it is to be used here.
Type: name (no spaces)
Required: no
Default: none

nullReturnsTrue

Whether the filter should return true if the specified expression returns null.
Type: boolean
Required: no
Default: none

No child elements for expression-filter.

Regex Filter

A filter that matches string messages against a regular expression. The Java regular expression engine (java.util.regex.Pattern) is used.

Attributes of regex-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

pattern

The property name and optionally a value to use when matching. If the expression is just a property name, the filter checks that the property exists. Users can also use '=' and '!=' to determine a specific value for a property.
Type: string
Required: yes
Default: none

flags

Comma-separated list of flags for compiling the pattern. Valid values are CASE_INSENSITIVE, MULTILINE, DOTALL, UNICODE_CASE and CANON_EQ.
Type: string
Required: no
Default: none

No child elements for regex-filter.

Message Property Filter

A filter that matches properties on a message. This can be very useful, as the message properties represent all the meta information about the message from the underlying transport, so for a message received over HTTP, you can check for HTTP headers and so forth. The pattern should be expressed as a key/value pair, such as propertyName=value. If you want to compare more than one property, you can use the logic filters for And, Or, and Not expressions. By default, the comparison is case sensitive, which you can override with the 'caseSensitive' property.

Attributes of message-property-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

pattern

The property name and optionally a value to use when matching. If the expression is just a property name, the filter checks that the property exists. Users can also use '=' and '!=' to determine a specific value for a property.
Type: string
Required: yes
Default: none

caseSensitive

If false, the comparison ignores case.
Type: boolean
Required: no
Default: true

scope

outbound

No child elements for message-property-filter.

Exception Type Filter

A filter that matches the type of an exception.

Attributes of exception-type-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

expectedType

The expected class used in the comparison.
Type: class name
Required: yes
Default: none

No child elements for exception-type-filter.

Payload Type Filter

A filter that matches the type of the payload.

Attributes of payload-type-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

expectedType

The expected class used in the comparison.
Type: class name
Required: yes
Default: none

No child elements for payload-type-filter.

Custom Filter

A user-implemented filter.

Attributes of custom-filter

Name Description

name

Identifies the filter so that other elements can reference it. Required if the filter is defined at the global level.
Type: name (no spaces)
Required: no
Default: none

class

An implementation of the Filter interface.
Type: class name
Required: no
Default: none

Child Elements of custom-filter

Name Cardinality Description

spring:property

0..*

Spring-style property element for custom configuration.