Base64 Encoder And Decoder Transformer With Mule ESB

Base64 is basically is used to encode and decode your data. As we need to secure our data, attachment, documents etc. when we send over the network. Base 64 can encode your data before sending to destination. Mule provide Base64 encoder transformer to encrypt the data and Base 64 decoder transformer to decrypt the data.

Base64 Encoder Transformer

A transformer that base64 encodes a string or byte array message.

  • name identifies the transformer so that other elements can reference it.
  • returnClass is class of message generated by transformer.
  • IgnoreBadInput many transformers only accept certain classes. Such transformers are never called with inappropriate input (whatever the value of this attribute).
  • encoding is string encoding used for transformer output.
  • mimeType if can be text/plain or plain/text.

Here is the flow for Base64 Encoder Transformer.

Base64 Encoder Transformer (Testing)

Place the any plain file in the input folder and it will be picked up by file connector and convert into base64. Final Base64 converted file will be saved to output folder.

Input File (.docx)


Output (Base64 Format)

Base64 Decoder Transformer

A transformer that base64 decodes a message to give an array of bytes.

  • name identifies the transformer so that other elements can reference it.
  • returnClass is class of message generated by transformer.
  • IgnoreBadInput many transformers only accept certain classes. Such transformers are never called with inappropriate input (whatever the value of this attribute).
  • encoding is string encoding used for transformer output.
  • mimeType if can be text/plain or plain/text.

Base64 Decoder Transformer

Here is the flow for Base64 Decoder Transformer.

Base64 Encoder Transformer (Testing)

Place the any base64 in the input folder and it will be picked up by file connector and it will decrypt the file. Final decrypted file will be saved to output folder.

Decrypted File (.docx)

Now, you know how to use base64 encoder and decoder transformer With Mule ESB.

Add a Comment

Your email address will not be published. Required fields are marked *