Enterprise Integration Patterns - Message Filter
Overview
A Message Filter is a special form of a Content-Based Router. It examines the message content and passes the message to a service only if the message content matches certain criteria, otherwise the message is discarded.
Use Cases
Selective Processing
If a consumer wishes to receive only messages whose content satisfy a given criteria, a message filter can be inserted on the message path to filter out unwanted messages. The consumer can focus on processing the requests it expects and does not have the overhead of processing each incoming message and discarding those it is not interested in processing
Message Filtering
Messages with sensitive/private content can be hidden from services which should not be receiving them by inserting a message filter, on the path to these services, which filters out the sensitive messages.
IFL
Syntax
filter [type] [name | expression]
type := filter implementation (xpath, regex)
name := named configuration which contains the filter details
expression := inline filter configuration
Examples
Xpath filter with inline configuration
ftp "foo"
jruby "verify-address"
route do
from "foo"
filter xpath ("//orders/order")
to "verify-address"
end
Xpath filter with external configuration
ftp "foo"
jruby "verify-address"
route do
from "foo"
filter xpath "ordersOnlyConfig"
to "verify-address"
end
$ cat ordersOnlyConfig/flow.properties
exp=//orders/order
In both the examples above only those messages which match the xpath expression will be allowed to continue.
Configuration
XPath
Regex
Packaging
Runtime
This page (revision-6) was last changed on
10-Mar-09 16:41 PM, -0700
by Nikita.
This page was created on
21-Oct-08 14:21 PM, -0700 by KeithBabo.
More info...
| Version |
Date |
Author |
Size |
Changes ... |
|
11
|
21-Jul-09 09:32 AM, -0700
|
DerekFrankforth |
5718 |
to previous
|
|
10
|
21-Jul-09 09:28 AM, -0700
|
DerekFrankforth |
5720 |
to previous
|
to last
|
|
9
|
21-Jul-09 07:22 AM, -0700
|
DerekFrankforth |
4674 |
to previous
|
to last
|
|
8
|
16-Mar-09 10:16 AM, -0700
|
Nikita |
4018 |
to previous
|
to last
|
|
7
|
10-Mar-09 16:58 PM, -0700
|
Nikita |
3940 |
to previous
|
to last
|
|
6
|
10-Mar-09 16:41 PM, -0700
|
Nikita |
1899 |
to previous
|
to last
|
|
5
|
10-Mar-09 16:40 PM, -0700
|
Nikita |
1898 |
to previous
|
to last
|
|
4
|
09-Mar-09 17:01 PM, -0700
|
Nikita |
1653 |
to previous
|
to last
|
|
3
|
09-Mar-09 14:02 PM, -0700
|
Nikita |
1098 |
to previous
|
to last
|
|
2
|
02-Mar-09 11:01 AM, -0800
|
Nikita |
181 |
to previous
|
to last
|
|
1
|
21-Oct-08 14:21 PM, -0700
|
KeithBabo |
2 |
to last
|