Ecotone
inject arguments to invoked method based on Parameter Converters
.
Parameter converters tells Ecotone
how to resolve specific parameter and what kind of argument is it expecting. Ecotone
does resolve parameters based on given attribute types.
Payload
- Does inject payload of the message. In our case it will be the command itself
Headers
- Does inject all headers as array.
Reference
- Does inject service from Dependency Container. If referenceName
which is name of the service in the container is not given, then it will take the class name as default.Ecotone
, if parameter converters are not passed provides default converters. Payload.
array
then Headers
converter is takenReference
converter is pickedPayload
converter is responsible for passing payload of the message to given parameter.
It contains of two attributes:expression
(Optional) - Allow for performing transformations before passing argument to parametercontentType
which describes content type of Message as media type. Based on this information, if payload of message is not compatible with parameter's type hint, Ecotone
do the conversion.Command Bus
with specific class instance. It may receive anything xml, json etc
as long as Converter for specific Media Type is registered in the system.payload
- which is just payload of currently handled Messageheaders
- contains of all headers available within Message reference
- which allow for retrieving service from Dependency Container and calling a method on it. The result of the expression will be passed to parameter after optional conversion.Headers
converter is responsible for passing all headers of the message as array to given parameter. Header
converter is responsible for passing specific header from message headers to given parameter.
It contains attributes:headerName
(Required) - Allow for performing transformations before passing argument to parameterexpression
- Allow for performing transformations before passing argument to parameter, same as in Payload expression​Payload Expression
, there is one more variable available value.
Value holds chosen header by headerName
attribute.Reference
converter is responsible for retrieving object from Dependency Container and passing it to given parameter.
It does contain attributes:referenceName
(Optional) - Reference name of given object in Dependency Container. If not passed, then type hint of given parameter will be used.