Contact Free trial Login

Creating Custom Transformers

Mule Runtime Engine versions 3.5, 3.6, and 3.7 reached End of Life on or before January 25, 2020. For more information, contact your Customer Success Manager to determine how you can migrate to the latest Mule version.

Transformers in Mule are used to convert messages from one format to another or to manipulate the message information such as headers and attachments. Mule ESB also provides several standard transformers, including XML transformers (such as XML to Object, XSLT, and DOM to XML), encryption transformers that encrypt and decrypt data, compression transformers that compress and decompress data, and more. For a list of the standard transformers in Mule, see Using Transformers.

There are two ways to create a transformer.

  1. Use a Transformer Annotation on a method. This transformer will be automatically discovered and will be available to Mule’s automatic transformation engine. Transformers created this way are not usually referenced in your Mule configuration, instead it will be discovered based on the current type of message payload and the required type need (i.e. the parameter type of a component method parameter).

  2. The traditional Mule way of creating custom transformers by extending AbstractTransformer

Was this article helpful?

💙 Thanks for your feedback!

Edit on GitHub