-
Notifications
You must be signed in to change notification settings - Fork 33
Transformer
EIP reference for Transformer can be found here - http://www.eaipatterns.com/MessageTransformationIntro.html
Continuation from Transformer could be expressed using '-->' operator.
Root DSL element for Transformer is transform
val transformer = transform.using { m: Message[_] => m }
If you need to add any extra properties to the Transformer you may do so using where method which accepts named parameters.
For example:
val transformerA = transform.using { m: Message[_] => m } where(name="myTransformer") //infix
val transformerB = transform.using { m: Message[_] => m }.where(name="myTransformer")
will produce a Transformer named 'myTransformer'.
name - component name
Unlike [Service Activator] (https://github.com/SpringSource/spring-integration-scala/wiki/Service-Activator) Transformer's transform.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 Core Messaging Patterns] (https://github.com/SpringSource/spring-integration-scala/wiki/Core-Messaging-Patterns)