Carriage Return
A recent post on the user list by Mule user Jack Wang asked what one would expect to be a simple question: How can you add a new line (CR) to a string payload for a MuleMessage?
String payloads in Mule are nothing more than simple strings held within a MuleMessage so trying to use the
Jack was working with files, so my first thought was to convert the entire payload to a byte-array (using Mule’s transformers) and add the appropriate characters to the end of the array but this could be more hassle than it’s worth.
The solution was, with hindsight, obvious. Jack ended up with the following transformer:
<append-string-transformer name="addCR" message="

"/>
Kudos to Jack Wang for sharing the solution with the rest of us.

If you enjoyed this post, make sure you subscribe to my RSS feed!