-
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.
val messageFilter = filter.using { m: Message[String] => m.getPayload.equals("foo") }
If you need to add any extra properties to the Message Filter you may do so using where method which accepts named parameters.
For example:
val messageFilterA = transform.using { m: Message[_] => m } where(name="myFilter") //infix
val messageFilterB = transform.using { m: Message[_] => m }.where(name="myFilter")
will produce a Message Filter named 'myFilter'.
Properties that could be set: 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 handle.using method signature is:
def using(function:Function1[_,AnyRef])
That is done to guard from Functions that return Unit since it woud violate the contract of the Transformer which must always return a value that is not Void/Unit.
[Back to Reference] (https://github.com/SpringSource/spring-integration-scala/wiki/Reference)