-
Notifications
You must be signed in to change notification settings - Fork 33
Message filter
EIP reference for Message Filter can be found here - http://www.eaipatterns.com/Filter.html
Continuation from Message Filter could be expressed using '-->' operator.
Root DSL element for Message Filter is filter
val messageFilter = filter { m: Message[String] => m.getPayload.equals("foo") }
If you need to add any extra properties to the Message Filter you may do so using additionalAttributes method which accepts named parameters.
For example:
val messageFilterA = filter { m: Message[_] => m } additionalAttributes(name="myFilter") //infix
val messageFilterB = filter { m: Message[_] => m }.additionalAttributes(name="myFilter")
will produce a Message Filter named 'myFilter'.
name - component name
exceptionOnRejection - boolean value which if set to 'true' will result in exception if Message does not pass a filtering criteria. If 'false' the Message wil be simply discarded.
Transformer's filter.apply method signature is:
def apply(function:Function1[_,Boolean])
That is done to guard from Functions that return anything other than Boolean to satisfy the Messaging Filter contract
[Back to Core Messaging Patterns] (https://github.com/SpringSource/spring-integration-dsl-scala/wiki/Core-Messaging-Patterns)