mulemule-studiomulesoftanypoint-studiomule-el

Mule 3 in Debug Mode - how do I view payload as JSON?


So this question is specific while running Anypoint Studio 6.x ( 6.6.10 ) in debug mode ( Mule 3 ) Now as a part of the implementation many a times the payload or variables are stored in format application/java which while debugging makes it difficult to visualise the data .

In case of Mule 4 in debugger I can simply enter the dataweave :

%dw 2.0
output application/json
---
payload

However this is not possible in Mule 3 , infact you cannot even enter a command spanning multiple lines

so question is - how to view payload in debug mode in json format in case of Mule3 ?


Solution

  • Mule 4 uses DataWeave 2 as its expression language. Mule 3 used MEL expressions. MEL doesn't directly supports JSON. You could try executing a DataWeave 1 transformation from MEL using the dw() function to convert the payload to JSON.

    dw("payload","application/json")
    

    I don't have a Studio 6 environment to test it right now.