Enrich the message
The difference in this use case from the earlier ones is that in this case, we already have a message that is in the correct format, but doesn't have the structure we need. For example, when we need to add information before sending the message to the backend, or when the response of the backend is similar to the response we need to reply to the client.
For modifying the content of the message, we can use Enrich mediator, Script mediator, XSLT mediator, FASTXSLT mediator, XQuery mediator, or Smooks mediator.
The Enrich mediator
The Enrich mediator can process the current payload for performing different actions such as replacing or adding child or sibling to a specific target of the message, such as envelope, body, or property.
The following is the syntax:
<enrich> <source [clone=true|false] [type=custom|envelope|body|property|inline] xpath="" property="" /> <target [action=replace|child|sibiling] [type=custom|envelope|body|property...