0
votes

I have a custom transformer that extends AbstractMessageTransformer. I use the mule message to get some data from a flowVar, and then create a JSON POJO using that data. From there I simply return the JSON POJO object.

My question is, is it okay to just return the new object or should I be setting it to payload of the mule message using message.setPayload and returning message? If so why?

The flow works fine by returning just the POJO object, however is this correct? Could there be some unforeseen outcomes down the line?

1

1 Answers

0
votes

You are doing it correctly. That returned object ideally becomes the result of transformation, the new payload.