Introduction

Coming from a BizTalk background, discovering differences between BizTalk and Mule is really interesting. Not necessarily to find one better than the other, but to appreciate differences in design and understand philosophy behind it.

Today I tried Set Payload Transformer and was amused with how it accesses and set payload with message context using Mule expression.

This transformer sets the payload to whatever you define. The payload can be a literal string or a Mule Expression.

I was particularly interested with being able to set the payload to whatever you define.

Set Payload is basically like a creating a response message for a request-response pattern in BizTalk.

In BizTalk, you will have to create a message schema and outputs xml message(flat file schema if you want to output flat structure of message).

Mule instead provides this convenient transformer called Set Payload and from there, you can set whatever you define - doesn’t have to be xml and you could access to message’s context information using Mule expression. Pretty cool?